批量刪除數據

declare
cursor mycur is select qb1.rowid from qb1,qb2 where qb1.t_pad=qb2.t_pad order by rowid;
type rowid_table_type is table of rowid index by pls_integer;
v_rowid rowid_table_type;
begin
open mycur;
loop 
fetch mycur bulk collect into v_rowid limit 300;
exit when v_rowid.count=0;
forall i in v_rowid.first..v_rowid.last
delete from qb1 where rowid=v_rowid(i);
commit;
end loop;
close mycur;
end;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章