Solved

find the stored procedure name in which we are in - Oracle

Posted on 2007-03-28
5
427 Views
Last Modified: 2013-12-07
From inside a stored procedure in Oracle 9 , how do we find the procedure name in which we are in.
0
Comment
Question by:aarch1
5 Comments
 
LVL 9

Expert Comment

by:konektor
ID: 18808859
i think there is no way how to detect it, probably few joins of v$session and v$sql you night detect what is executing now, but theese views cannot be queried by anyone, only by users having SELECT_CATALOG_ROLE
0
 

Author Comment

by:aarch1
ID: 18808948
Thanks  konektor.
But we may not be able to give that  SELECT_CATALOG_ROLE to the users.
--
This is a stored procedure using "htp" and "owa_util" packages being run in web uing Oracle 9ias.
I did find a owa_util.get_procedure which is able to get me a procedure name which is being run
from the web.
--
The problem is the web procedure (say proc1) calls proc2 inside which is being shown in the
web browser.
--
owa_util.get_procedure  returns me the name proc1. Is there away to get the name proc2
which is acually shown in the browser by proc1?

Thanks
0
 
LVL 27

Accepted Solution

by:
sujith80 earned 500 total points
ID: 18814488
You can use DBMS_UTILITY package to find the name of the stored procedure from within it. All you have to do is format the output in the way you want. See the usage:

create or replace procedure test_proc
as
 l_str varchar2(4000);
begin
 l_str := dbms_utility.format_call_stack;

 dbms_output.put_line(substr(l_str,1, 256));
end;
/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now