select ....
bulk collect ....
from table name
where ....
bulk collect retrieve a bunch of data...
create table bc (
a number,
b varchar2(10)
);
insert into bc values (11,'elf');
insert into bc values (12,'zwoelf');
insert into bc values (13,'dreizehn');
insert into bc values (14,'vierzehn');
commit;
set serveroutput on size 10000
declare
type t_bc_a is table of bc.a%type;
type t_bc_b is table of bc.b%type;
l_bc_a t_bc_a;
l_bc_b t_bc_b;
begin
select a, b bulk collect into l_bc_a, l_bc_b from bc;
for i in l_bc_a.first .. l_bc_a.last loop
dbms_output.put_line(l_bc_a(i) || ', ' || l_bc_b(i));
end loop;
end;
/
Sunday, February 17, 2008
Subscribe to:
Posts (Atom)