Home » SQL & PL/SQL » SQL & PL/SQL » how to find the parent/host procedure's name within the procedure (any version of oracle(preferrably 10g onwards))
icon7.gif  how to find the parent/host procedure's name within the procedure [message #595083] Fri, 06 September 2013 06:23 Go to next message
shashikoor1
Messages: 2
Registered: March 2013
Junior Member
I have the following requirement.

Say I have the following procedure created.
create or replace procedure myproc (p1 varchar2, p2 varchar2)
is begin

find_the_proc_name();

end;


In the above myproc, using find_the_proc_name() i should print the parent procedure name (or function) calling along with the parameters passed.

Is there any way to achieve this.

kindly suggest/help.

thanks
shashanka
Re: how to find the parent/host procedure's name within the procedure [message #595085 is a reply to message #595083] Fri, 06 September 2013 08:54 Go to previous messageGo to next message
Lalit Kumar B
Messages: 2148
Registered: May 2013
Location: World Wide on the Web
Senior Member
If you just want to know which program unit is being executed(who_am_i), use $$PLSQL_UNIT, it is for 10g and up releases.

To print the parameters being passed, there is no direct way other than just using DBMS_OUTPUT.PUT_LINE for the variables.

[Updated on: Fri, 06 September 2013 08:56]

Report message to a moderator

Re: how to find the parent/host procedure's name within the procedure [message #595088 is a reply to message #595085] Fri, 06 September 2013 09:46 Go to previous messageGo to next message
_jum
Messages: 489
Registered: February 2008
Senior Member
May be you are looking for FORMAT_CALL_STACK to find parent procedure.

[Updated on: Fri, 06 September 2013 09:48]

Report message to a moderator

Re: how to find the parent/host procedure's name within the procedure [message #595089 is a reply to message #595088] Fri, 06 September 2013 09:55 Go to previous messageGo to next message
BlackSwan
Messages: 22712
Registered: January 2009
Senior Member
http://www.lmgtfy.com/?q=Oracle+who+called+me
Re: how to find the parent/host procedure's name within the procedure [message #595092 is a reply to message #595083] Fri, 06 September 2013 10:05 Go to previous messageGo to next message
Michel Cadot
Messages: 58918
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

http://www.orafaq.com/forum/mv/msg/124844/347853/102589/#msg_347853

Regards
Michel
Re: how to find the parent/host procedure's name within the procedure [message #595456 is a reply to message #595092] Wed, 11 September 2013 06:14 Go to previous message
shashikoor1
Messages: 2
Registered: March 2013
Junior Member
Thank you very much all
Previous Topic: mysql to oracle
Next Topic: Error: PLS-00103 in package
Goto Forum:
  


Current Time: Thu Aug 28 02:27:43 CDT 2014

Total time taken to generate the page: 0.11144 seconds