Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how can a PL/SQL identify itself?
Am 21 Jan 2005 01:20:23 -0800 schrieb A Billington <billiauk_at_yahoo.co.uk>:
> DBMS_APPLICATION_INFO provides SET_CLIENT_INFO and SET_ACTION
> procedures for you to "register" your package as already stated above.
> However, you don't need to query anything to get the information back -
> use SYS_CONTEXT( 'userenv', 'client_info' ) or SYS_CONTEXT( 'userenv',
> 'action' ) e.g.
According to my 9i-Docs and a test 'action' is not a valid userenv parameter. Additionally the 'module_name' cannot be retrieved via userenv.
> Although if you have multiple packages executing, then they will be
> wiping each other out. Far better in this case to use the call stack to
> get your information - see Tom Kyte's "WHOAMI" function at
> asktom.oracle.com. It enables a PL/SQL package or procedure to retrieve
> its top-level name from the call stack.
A nice application of DBMS_UTILITY.FORMAT_CALL_STACK(). Thanks for the ref!
Regards
-- Frank Piron, defrankatkonaddot (leftrotate two)Received on Fri Jan 21 2005 - 04:29:54 CST