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

From inside a stored procedure in Oracle 9 , how do we find the procedure name in which we are in.
Who is Participating?
sujith80Connect With a Mentor Commented:
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
 l_str varchar2(4000);
 l_str := dbms_utility.format_call_stack;

 dbms_output.put_line(substr(l_str,1, 256));
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
aarch1Author Commented:
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?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.