3,491
社区成员
发帖
与我相关
我的任务
分享
create or replace procedure hb_table(tj A.a1%type)
is
begin
for l_record in (select a.a1,a.a2,a.a3,a.a4,b.b3 from A a,B,b where a5 = '333' and a.a5 = b.a5)
loop
insert into C values l_record;
end loop;
commit;
end;
create or replace procedure hb_table(tj A.a1%type)
is
--
--声明--
--va1
--va2
cursor cur_hb is
select a.a1,a.a2,a.a3,a.a4,b.b3 from A a,B,b where a5 = '333' and a.a5 = b.a5;
type t_a1 is table of a.a1%type index by binary_integer;
va1 t_a1;
-- same for va2,va3,va4,vb3
...
begin
open v_zj;
loop
fetch v_zj bulk collect into va1,va2,va3,va4,vb3
limit 1000;
forall i in va1.first..va1.last
insert into C values(va1(i),va2(i),va3(i),va4(i),vb3(i));
exit when v_zj%notfound;
end loop;
close v_zj;
commit;
end;