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

Home -> Community -> Usenet -> c.d.o.server -> Re: Can a PL/SQL procedure or function tell its own name ?

Re: Can a PL/SQL procedure or function tell its own name ?

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Fri, 16 Nov 2007 22:00:58 +0100
Message-ID: <473E050A.80006@gmail.com>


Syltrem schrieb:
> Hello
>
> I'm looking for a way to tell, in a PL/SQL named procedure or function, the
> name of the procedure or function.
>
> For example
>
> CREATE or REPLACE PROCEDURE XXX as
> BEGIN
> dbms_output.put_line('this is procedure XXX running');
> END;
> /
>
> Is there a special variable like those ora_something that exist, which would
> contain the name of the executing procedure ? Or some other way to do this ?
>
> Thanks !
>
> Syltrem
> Oracle 10gr2 on OpenVMS
>
>

Look at conditional compilation
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/fundamentals.htm#BABIHIHF

SQL> CREATE or REPLACE PROCEDURE XXX as

   2 BEGIN
   3 dbms_output.put_line('this is procedure '||$$PLSQL_UNIT||' running');    4 END;
   5 /

Procedure created.

SQL> set serveroutput on
SQL> exec XXX
this is procedure XXX running

PL/SQL procedure successfully completed.

Best regards

Maxim Received on Fri Nov 16 2007 - 15:00:58 CST

Original text of this message

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