declare
rows int :=1000;
CURSOR del_cursor IS select id from RPT_REPORTANNEX where originalcode in (select id from rpt_researchreport where pubdate <= date'2011-01-01');
TYPE del_table_type is table of RPT_REPORTANNEX.Id%type INDEX BY BINARY_INTEGER;
del_table del_table_type ;
begin
open del_cursor;
loop
fetch del_cursor bulk collect into del_table limit rows;
forall i in 1..del_table.count
delete from RPT_REPORTANNEX where id = del_table(i);
commit;
exit when del_cursor%notfound;
end loop;
close del_cursor ;
end ;
/
阅读(2323) | 评论(0) | 转发(0) |