Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Calling Procedure

Re: Calling Procedure

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 25 May 2005 07:00:20 -0700
Message-ID: <1117029356.609290@yasure>


Björn Wächter wrote:
> Hi all,
> is there a way in oracle to get the name
> of the calling procedure?
>
>
> Example:
>
>
> ==========================================================
> PROCEDURE Sp_AAAAA
> AS
> BEGIN
>
> dbms_output.put_line('Called by: ' || ?????????? );
>
> END Sp_AAAAA;
>
> ==========================================================
>
> PROCEDURE Sp_BBBB
> AS
> BEGIN
>
> Sp_AAAAA;
>
> END Sp_BBBB;
>
> ==========================================================
>
>
> Output:
>
> Called by: Sp_BBBB
>
>
>
> Thanks Björn

Why and in what version?

I'm inclined to agree with Frank that this is just a bad habit you are trying to bring with you but there is one valid reason and that is when an exception is raised. If that is the case you can use:

dbms_utility.format_call_stack
dbms_utility.format_error_backtrace
dbms_utility.format_error_stack

A demo of this functionality can be found at: http://www.psoug.org
click on Morgan's Library
click on Exception Handling

-- 
Daniel A. Morgan
Relational theory is not something that is simply a nice-to-have.
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Wed May 25 2005 - 09:00:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US