abdeen-ahmad
3/6/2016 - 9:53 AM

Comparison between cursors types

Comparison between cursors types

--implicit cursor (row by row)  0.37
for rec in (select * from parts)
loop
pnums(sql%rowcount)    := rec.partnum;
pnames(sql%rowcount)    := rec.partname;
end loop;

--Explioit cursor (row by row)  take 5 Sec.
cursor cur is select * from parts;
rec cur%rowtype;
open cur;
loop
fetch cur into rec;
exit when cur%notfound;
end loop;
close cur;

--Bulk cursor   0.19
type numtab is a table of parts.patnum%type index by binary_integer;
type numtab is a table of parts.patname%type index by binary_integer;
select * bulk collect 
into   p_nums,pnames
from   parts;