Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> cursors question
I had written the following SQL statement in a file called stat.sql
select name,value
from v$mystat m,v$statname s
where m.statistic# in(2,3,179,180,181)
and m.statistic#=s.statistic#
Can you please tell me the difference between the following 2 procedures
1)
SQL>@stat
NAME VALUE
------------------------------------------------ ----------
opened cursors cumulative 133 opened cursors current 1 parse count (total) 139 parse count (hard) 13 execute count 167
SQL>@stat
NAME VALUE
------------------------------------------------ ----------
opened cursors cumulative 136 opened cursors current 1 parse count (total) 142 parse count (hard) 13 execute count 170
2)
SQL>get stat
1 select name,value
2 from v$mystat m,v$statname s
3 where m.statistic# in(2,3,179,180,181)
4 and m.statistic#=s.statistic#
SQL>/
NAME VALUE
------------------------------------------------ ----------
opened cursors cumulative 138 opened cursors current 1 parse count (total) 144 parse count (hard) 13 execute count 172
SQL>get stat
1 select name,value
2 from v$mystat m,v$statname s
3 where m.statistic# in(2,3,179,180,181)
4 and m.statistic#=s.statistic#
SQL>/
NAME VALUE
------------------------------------------------ ----------
opened cursors cumulative 139 opened cursors current 1 parse count (total) 145 parse count (hard) 13 execute count 173
You can see that SQL*PLUS is taking 3 cursors for each @stat
i turned on tracing and saw that it is because it is calling
DBMS_APPLICATION_INFO.SET_MODULE procedure.
Why is it calling that procedure when i say @stat and why not when i
say get the stat file and execute it?
Thanks in advance for any help
Received on Mon Jun 24 2002 - 23:54:43 CDT