CREATE OR REPLACE PROCEDURE "SP_TEMP_TEST" as
a_id integer;
cursor cur_a is select c.id from tab_content c where c.type='ARTICLE' order by c.createtime;
begin
open cur_a;
fetch cur_a into a_id;
while cur_a%found loop
update tab_content c set c.sequence = temp_sequence.nextval where c.id=a_id;
fetch cur_a into a_id;
end loop;
close cur_a;
commit;
end;
a_id integer;
cursor cur_a is select c.id from tab_content c where c.type='ARTICLE' order by c.createtime;
begin
open cur_a;
fetch cur_a into a_id;
while cur_a%found loop
update tab_content c set c.sequence = temp_sequence.nextval where c.id=a_id;
fetch cur_a into a_id;
end loop;
close cur_a;
commit;
end;