Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-28
5
Medium Priority
?
501 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to take different types of Oracle backups using RMAN.

705 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