table:tabbcorp
-- corpname varchar2(20),
-- corpno varchar2(10)
declare
type t_corps is table of tabbcorp%rowtype;
s_corps t_corps;
begin
select * bulk collect into s_corps from tabbcorp;
for i in s_corps.first .. s_corps.last loop
dbms_output.put_line(to_char(i) ||' : ' || s_corps(i).corpname);
end loop;
end;
-- corpname varchar2(20),
-- corpno varchar2(10)
declare
type t_corps is table of tabbcorp%rowtype;
s_corps t_corps;
begin
select * bulk collect into s_corps from tabbcorp;
for i in s_corps.first .. s_corps.last loop
dbms_output.put_line(to_char(i) ||' : ' || s_corps(i).corpname);
end loop;
end;
BULK COLLECT INTO, 在Oracle 9.2.0.3 (包含9.2.0.3)一下版本不能使用Bulk Collect Into 语句,在Oracle9.2.0.4 及其以上版本可以使用;否则则提示 PLS—00597 错误