clear screen
set serveroutput on size unlimited
select banner from v$version
drop table FatMcDodd
prompt create a big fat table
create table FatMcDodd as select * from NedMcDodd where 1=2
begin
for indx in 1 .. 10000 loop
insert into FatMcDodd select * from NedMcDodd;
end loop;
commit;
end;
select count(*) from FatMcDodd
set timing on
declare
cursor c_FatMcDodd
is
select * from FatMcDodd;
type t_FatMcDodd is table of FatMcDodd%rowtype index by pls_integer;
lFatMcDodd t_FatMcDodd;
l_id FatMcDodd.id%type;
begin
open c_FatMcDodd;
loop
fetch c_FatMcDodd bulk collect into lFatMcDodd limit 10000;
exit when lFatMcDodd.count = 0;
for indx in lFatMcDodd.first .. lFatMcDodd.last loop
l_id := lFatMcDodd(indx).id;
end loop;
end loop;
end;
set timing off