Solved

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

Posted on 2007-03-28
5
453 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

828 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