Execute immediate SQL
Sql string tranformation ...
Start file
insert into tabtmp (no_part, deptname, firtname, lastname ) select no_part, deptname, firtname, lastname from emp e,dept d where e.no_part=10 and d.no_part=10 and e.deptno=d.deptno;
End file
c_part:=10; execute immediate " insert into tabtmp"|| " (no_part,"|| " deptname,"|| " firtname,"|| " lastname"|| " )"|| " select"|| " no_part,"|| " deptname,"|| " firtname,"|| " lastname"|| " from"|| " emp e,dept d"|| " where e.no_part="||c_part|| " and d.no_part="||c_part|| " and e.deptno=d.deptno";
View Diff
1,16c1,18 < insert into tabtmp < (no_part, < deptname, < firtname, < lastname < ) < select < no_part, < deptname, < firtname, < lastname < from < emp e,dept d < where e.no_part=10 < and d.no_part=10 < and e.deptno=d.deptno; --- > c_part:=10; > execute immediate > " insert into tabtmp"|| > " (no_part,"|| > " deptname,"|| > " firtname,"|| > " lastname"|| > " )"|| > " select"|| > " no_part,"|| > " deptname,"|| > " firtname,"|| > " lastname"|| > " from"|| > " emp e,dept d"|| > " where e.no_part="||c_part|| > " and d.no_part="||c_part|| > " and e.deptno=d.deptno";
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 31 remaining solutions by signing in and submitting your own entry