Is there a way of knowing the name of a calling procedure from within a function without passing the name as a parameter?
Date: 30 Mar 2004 03:51:04 -0800
Message-ID: <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 Received on Tue Mar 30 2004 - 13:51:04 CEST