当前位置: 移动技术网 > IT编程>数据库>Oracle > Oracle BULK COLLECT批量取数据解决方法

Oracle BULK COLLECT批量取数据解决方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

拜见岳父大人3,好大一棵树歌谱,东营吉奥汽车

复制代码 代码如下:

-- created on 2010/11/04 by wangnan
declare
-- local variables here
i integer;
type t_table is table of varchar2(10 ) index by varchar2 (2);
v_t_table t_table;

type t_pg3 is table of asis.pg3_agentcd_conversion% rowtype;
v_pg3_table t_pg3;

c_pg3_vendor com.cref;
v_str varchar2( 250);
begin
-- test statements here
open c_pg3_vendor for select * from asis.pg3_agentcd_conversion;

fetch c_pg3_vendor bulk collect into v_pg3_table;
for i in 1 .. v_pg3_table.count loop
v_t_table(v_pg3_table(i).asis_agent_cd) := v_pg3_table(i).tobe_vendor_cd;
end loop;

v_str := v_t_table.first;
while v_str is not null loop
dbms_output.put_line(v_str || ' : ' ||v_t_table(v_str));
v_str := v_t_table.next(v_str);
end loop;

exception when others then
dbms_output.put_line( sqlerrm);
end;

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网