Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> cursors question
I was testing this while reading Tom Kyte's book
Can anyone help clarify my doubt
select name,value
from v$sysstat
where name like '%parse count%'
NAME VALUE
------------------------------------------- -------
Parse count(total) 5049 Parse count(hard) 1214
declare
type rc is ref cursor;
l_rc rc;
l_dummy all_objects.object_name%type;
begin
for i in 1..1000 loop
open l_rc for 'select object_name from all_objects where object_id=
'||i;
fetch l_rc into l_dummy;
close l_rc;
end loop;
end;
After the
NAME VALUE
------------------------------------------- -------
Parse count(total) 7117 Parse count(hard) 2222
My doubt is why did the anonymous PL/SQL block cause more than 2000
soft parses
and about 100 hard parses.
I turned on tracing and saw that
select text from view$ where rowid=:1 is taking 1000 parses, executes
and fetches each.
Why is this statement taking 1000 parses ?
thanks in advance for any reply. Received on Mon Jul 01 2002 - 08:31:02 CDT
![]() |
![]() |