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: Jetlag <jetlag11235_at_yahoo.com>
Date: 17 Aug 2003 12:03:09 -0700
Message-ID: <2eeed00e.0308171103.5578ed9c@posting.google.com>


> > 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 ...

Received on Sun Aug 17 2003 - 14:03:09 CDT

Original text of this message

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