Re: Is there a way of knowing the name of a calling procedure from within a function without passing the name as a parameter?

From: Kalmact <kalmact_at_hotmail.com>
Date: 30 Mar 2004 08:14:15 -0800
Message-ID: <8007e332.0403300814.3fc00b87_at_posting.google.com>


jose.cuervo_at_lycos.co.uk (Dimitri) wrote in message news:<2452bd93.0403300351.40789772_at_posting.google.com>...
> Hi all,
>
> I've created a procedure in PL/SQL that inserts an error message into
> an error table. Let's call this proc_insert_error.
>
> The calling procedures (where the errors are raised), currently need
> to pass their own procedure name and the package name to which they
> belong to, to the error function as a parameter.
>
> This makes my code look cluttered and ugly as I'm passing the same
> hardcoded string to the error procedure.
> For example:
>
> Procedure proc_caller
>
> BEGIN
> Some code here
> .
> .
> .
> An error is raised
> EXCEPTION
> WHEN NO_DATA_FOUND THEN
> proc_insert_error("The package where this procedure
> belongs.proc_caller","no data found"...etc)
> WHEN OTHERS THEN
> proc_insert_error("The package where this procedure
> belongs.proc_caller","no data found"...etc)
>
> End proc_caller
>
> Is there a way of knowing from within proc_insert_error the name and
> package name of the calling procedure that raised the error? Perhaps
> in some sort of meta variable, or am I asking too much?
>
> Thanks
See
http://asktom.oracle.com/~tkyte/who_called_me/index.html Regards,
Kal Received on Tue Mar 30 2004 - 18:14:15 CEST

Original text of this message