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: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: Mon, 18 Aug 2003 06:48:44 -0400
Message-ID: <3255264.1061203724@dbforums.com>

Originally posted by Jetlag

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

Before you go about re-inventing the wheel, why exactly do you need to know the name of procedure being called at runtime? What is the requirement? Maybe someone can offer a better solution if you provide more details.

Regards

/Rauf Sarwar

--
Posted via http://dbforums.com
Received on Mon Aug 18 2003 - 05:48:44 CDT

Original text of this message

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