17,086
社区成员
发帖
与我相关
我的任务
分享
declare
cursor mycursor is select rowid from 表名称 where 取数条件
type rowid_table_type is table of rowid index by pls_integer;
v_rowid rowid_table_type;
begin
open mycursor;
loop
fetch mycursor bulk collect into v_rowid limit 10000; --每次处理10000行,也就是每10000行提交1次
exit when v_rowid.count=0;
forall i in v_rowid.first..v_rowid.last
delete from 表名称 where rowid = v_rowid(i);
commit;
end loop;
close mycursor;
end;
/
剩下的自行思考