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;
bulk collect forall通过limit批量提交
原创mb646da62f0d7e4 ©著作权
©著作权归作者所有:来自51CTO博客作者mb646da62f0d7e4的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Bulk Collect/FORALL的性能测试
有同学在T.Askmaclean.com上提问关于bulk
Oracle 数据库 bulk collect forall -
用Forall与bulk collect快速复制表数据
本文中介绍的几种写法分别是从代码的简易性,FORALL和bulk collect的使用,以及分批插入这三方面考虑
table manager date email sql -
Oracle中的Bulk Collect
bulk collect的作用 将查询出来的多条记录以集合的方式打包。举例: 创建表
oracle 职场 休闲 Oracle bulk collect -
再议OPEN CURSOR与BULK COLLECT
有同学在T.askmaclean.com上发帖关于bulk collect与open cursor的问题, 帖子的地址在这里。
Oracle 数据库 open cursor