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: accessing (packaged) procedure name within procedure

Re: accessing (packaged) procedure name within procedure

From: Ron Reidy <r_reidy_at_comcast.net>
Date: Sun, 17 Aug 2003 13:26:54 -0600
Message-ID: <3F3FD6FE.4070205@comcast.net>


Look at using dbms_application_info.

Jetlag wrote:

>>>Does anyone know of a system variable or some kind of logic which
>>>would return a string containing the name of the currently executing
>>>procedure?
>>
>>It can not be done nor does it make any sense unless you are assuming an
>>Oracle database with a single connected user.

>
>
> I'll admit that my question may not have been clear, but it does make
> sense in the context asked -- no matter how many users are connected.
> Any particular procedure is always running as a particular user ...
> either as the owner or the caller (using authid). If procedure X is
> called by procedure Y, then it is legitimate to believe that procedure
> Y can identify procedure X without any special arguments from X.
> Indeed, this works when X is not wrapped in a package (see
> dbms_utility.format_call_stack).
>
>
>>v_$sga
>>v_$open_cursors
>>v_$sql_area
>>v_$sessions

>
>
> I cannot see how v_$sga or v_$sga_area could possibly be of use here.
> I am less familiar with v_$open_cursors, but scanning the contents, it
> does not appear an entry is made for each procedure execution.
> Perhaps I am missing something obvious here, though.
>
> One potential solution is just to have a variable local to each
> packaged procedure/function which identifies the procedure/function by
> name. This variable could then be passed to any procedure/function
> needing to know the name of its predecessor. I was hoping to avoid
> this ...
>
> -- jetlag --
-- 
Ron Reidy
Oracle DBA
Received on Sun Aug 17 2003 - 14:26:54 CDT

Original text of this message

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