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;