您的位置:首页 > 其它

bulk collect forall通过limit批量提交

2012-10-19 09:33 405 查看
declare

type forall_table is table of tb1%rowtype;

test_table forall_table;

cursor c1 is select *

from infores_nb1.tb1 a

where exists (select 1

from infores_nb1.t2 b

where a.subscode = b.worksheetcode)

and a.intftype in ('resourceConfig', 'resourceRollback')

and a.succeed = 1;

begin

open c1;

loop

fetch c1 bulk collect into test_table limit 1000;--1000行提交一次;

forall idx in test_table.first..test_table.last

insert into tb1_tmp values test_table(idx);

commit;

exit when c1%notfound;

end loop;

close c1;

exception

when others then

rollback;

end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: