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: PL/SQL dynamically reporting argv[0] in function or procedure

Re: PL/SQL dynamically reporting argv[0] in function or procedure

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: 8 Sep 2006 05:37:34 -0700
Message-ID: <1157719054.704472.252670@h48g2000cwc.googlegroups.com>


heber.s.pam_at_gmail.com wrote:
> I need pl/sql objects to "dynamically" 'learn' what their object_name
> is. For example:
> create or replace function echo_my_name (inStr varchar2) return
> varchar2 IS
> BEGIN
> return 'The function '|| {function_name} ||
> ' received '||inStr||' as argv[1]';
> END;
> /
>
> I want to know what it takes for me to replace {function_name} in this
> function so that it would return "ECHO_MY_NAME". In c I would be
> using argv[0], but I do not know the syntax to do so in PL/SQL.
> I believe you have the capacity, because your own error-stack
> messages often include the offending object's name.

http://asktom.oracle.com/~tkyte/who_called_me/index.html One of the routines, who_called_me, is exposed in OWA_UTIL package, shipped with all recent Oracle releases. Note that the original code needs some fixing for 64-bit platforms (implemented in OWA_UTIL as fix for bug 718865,) but works like a charm on 32-bit Oracle.

Hth,

    Vladimir M. Zakharychev
    N-Networks, makers of Dynamic PSP(tm)     http://www.dynamicpsp.com Received on Fri Sep 08 2006 - 07:37:34 CDT

Original text of this message

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