Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> hard parse and a variable inlist
I asked a question about hard parses on Friday. What I am trying to do is tell whether my variable inlist code is incurring a hard parse or not before moving forward. Here is the test I am doing.
select b.name,a.*
from v$sesstat a, v$statname b
where a.statistic# = b.statistic#
and a.sid = (select distinct sid from v$mystat)
and name like '%parse%'
3. Run the test 4. Check for parsing again to see if hard parse increments. 5. I then change the value that I am selecting on in my test(ie variable := 1, is not variable := 2) and run again 6. I run the parse script and get a hard parse. 7. However, I also trace the pl/sql with a 10046 trace and when I check the 'parse' row of the statistics table, I get only .01 CPU usage and nothing else, which implies to me that a hard parse is not occurring.
The code I am using is below and is generic. Can someone help me to understand the discrepency(I hope this question isn't too long).
CREATE OR REPLACE PACKAGE BODY GetInList AS
FUNCTION GetNumberList (pString IN VARCHAR2) RETURN NumberTableType
IS
-- l_string long default pString || ',';
l_string VARCHAR2(2000); l_data NumberTableType := NumberTableType(); n NUMBER;
LTRIM( RTRIM( SUBSTR( l_string,1,n-1)));
l_string := SUBSTR (l_string,n+1);
END LOOP;
RETURN l_data;
END;
END GetInList;
/
![]() |
![]() |