  | | | -none- | -none- 2007-10-02 - By Thotangare, Ajay (GTI)
Back Hi,
I have a question about v$sqlarea. Appreciate your help/inputs on this. Background -- ---- ---- ---- I have a procedure named 'XYZ' and inside this procedure I have select statement. When I execute this procedure I can see a entry for procedure 'XYZ' and also a entry for select statement (which is actually inside procedure). How do I know if this select statement has come from this procedure or somebody else fired this statement as standalone (not using procedure) e.g. create or replace procedure PQR as begin execute immediate 'select object_name AS INSIDE_PQR_PRC from user_objects'; end; / Procedure created.
SQL> exec PQR; PL/SQL procedure successfully completed.
SQL> select rownum,sql_text,executions from v$sqlarea where sql_text like '%PQR%'; ROWNUM SQL_TEXT EXECUTIONS -- --- -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- -- ---- -- 1 select rownum,sql_text,executions from v$sqlarea where sql_text l 3 ike '%PQR%' 2 BEGIN PQR; END; 1 3 select object_name AS INSIDE_PQR_PRC from user_objects 1 3 rows selected.
How do I know that statement "select object_name AS INSIDE_PQR_PRC from user_objects" is actually fired from procedure and not from outside. Appreciate your help.
regards, Ajay Thotangare 212-647-4312 -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender , do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction , or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
<HTML xmlns:eXclaimer="http://www.exclaimer.co.uk" xmlns:msxsl="urn:schemas -microsoft-com:xslt" xmlns:exc="http://www.exclaimer.co.uk/rtf"> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-16 (See http://UTF-16.ora-code.com)">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6619.12"> <TITLE>Link procedure to sql statement in v$sqlarea</TITLE> </HEAD> <BODY > <DIV> <!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi,</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">I have a question about v$sqlarea. Appreciate your help/inputs on this.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Background</FONT>
<BR><FONT SIZE=2 FACE="Arial">-- ---- ---- ----</FONT>
<BR><FONT SIZE=2 FACE="Arial">I have a procedure named 'XYZ' and inside this procedure I have select statement. When I execute this procedure I can see a entry for procedure 'XYZ' and also a entry for select statement (which is actually inside procedure). How do I know if this select statement has come from this procedure or somebody else fired this statement as standalone (not using procedure)</FONT></P>
<P><FONT SIZE=2 FACE="Arial"> e.g.</FONT>
<BR><FONT SIZE=2 FACE="Arial">create or replace procedure PQR as</FONT>
<BR><FONT SIZE=2 FACE="Arial">begin </FONT>
<BR><FONT SIZE=2 FACE="Arial">execute immediate 'select object_name AS INSIDE _PQR_PRC from user_objects'; </FONT>
<BR><FONT SIZE=2 FACE="Arial">end;</FONT>
<BR><FONT SIZE=2 FACE="Arial">/</FONT>
<BR><FONT SIZE=2 FACE="Arial">Procedure created.</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">SQL> exec PQR;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">PL/SQL procedure successfully completed.</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">SQL> select rownum,sql_text,executions from v $sqlarea where sql_text like '%PQR%';</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">ROWNUM SQL_TEXT EXECUTIONS</FONT>
<BR><FONT SIZE=2 FACE="Arial">-- --- -- ---- ---- ---- ---- ---- ---- ---- ---- -- ---- ---- ---- ----- -- ---- --</FONT>
<BR><FONT SIZE=2 FACE="Arial"> 1 select rownum,sql_text ,executions from v$sqlarea where sql_text l 3</FONT>
<BR><FONT SIZE=2 FACE="Arial"> ike '%PQR%'< /FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> 2 BEGIN PQR; END; 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> 3 select object_name AS INSIDE_PQR_PRC from user_objects   ; 1< /FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">3 rows selected.</FONT> </P> <BR>
<P><FONT SIZE=2 FACE="Arial">How do I know that statement "select object _name AS INSIDE_PQR_PRC from user_objects" is actually fired from procedure and not from outside.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Appreciate your help.</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">regards,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Ajay Thotangare</FONT>
<BR><FONT SIZE=1 FACE="Arial">212-647-4312</FONT> </P>
</DIV> <DIV> <HR COLOR="gray"> </DIV> <DIV><BODY >This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e -communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: <A HREF="http ://www.ml.com/e-communications_terms/">http://www.ml.com/e-communications_terms/ </A>. By messaging with Merrill Lynch you consent to the foregoing.</BODY></DIV> <DIV> <HR COLOR="gray"> </DIV> <DIV> </DIV></BODY></HTML>
|
|
 |