I am looking for a way to identify the name of the procedure from within that procedure, something like $0 of Unix. Is this possible?
I need to log errors in a table, and want to identify the procedure that caused the error. Other options are are welcome.
You need to help us by following the Posting Guidelines as stated below. http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.
GOOGLE is your friend but only when you actually use it.
Michel Cadot Messages: 28991 Registered: March 2007 Location: Nanterre, France, http://...
Senior Member
SQL> create or replace procedure p is
2 begin
3 dbms_output.put_line('I am '||$$PLSQL_UNIT||' at line '||$$PLSQL_LINE);
4 end;
5 /
Procedure created.
SQL> exec p
I am P at line 3
PL/SQL procedure successfully completed.
ashoka_bl Messages: 315 Registered: November 2006 Location: Bangalore
Senior Member
@Michel,
In which version of oracle will that procedure you mentioned execute ? I am getting some error message when try to execute,
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/37 PLS-00103: Encountered the symbol "$" when expecting one of the
following:
( - + case mod new null <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current max min prior sql stddev sum variance execute
forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set
specification>
<an alternatively-quoted SQL string>
LINE/COL ERROR
-------- -----------------------------------------------------------------
Version
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
PL/SQL Release 10.1.0.2.0 - Production
CORE 10.1.0.2.0 Production
TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production