日期:2014-05-17 浏览次数:20955 次
declare
v_maxrows number default 1000;
v_rowid dbms_sql.Urowid_Table;
cursor cur is
select rowid from emp t1 where t1.sal = 810 order by T1.rowid;
v_counter number;
begin
v_counter := 0;
open cur;
LOOP
EXIT WHEN cur%NOTFOUND;
FETCH cur bulk collect
into v_rowid limit v_maxrows;
forall i in 1 .. v_rowid.count
update emp set sal = sal + 10 where rowid = v_rowid(i);
commit;
end loop;
end;
/