1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
declare cursor cursor_id is select COLUMN_1 from a_test1 order by COLUMN_1 desc ; cid cursor_id%rowtype; begin open cursor_id; loop fetch cursor_id into cid; Exit when cursor_id%notfound; if cid.COLUMN_1 <> 1400 then insert into A_TEST2(column_1, column_2) values (cid.COLUMN_1+1000,'aaa'); end if; end loop; EXCEPTION when others then close cursor_id; if cursor_id%isopen then close cursor_id; end if; commit; end;
|