Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> accessing (packaged) procedure name within procedure
Linux, Oracle 9.2.0.1
Does anyone know of a system variable or some kind of logic which would return a string containing the name of the currently executing procedure?
I have tried using dbms_utility.format_call_stack, but this doesn't seem to work when a procedure (or function) is wrapped in a package. For example, if I have a package my_pak containing a procedure my_prc, and I call a utility function which uses dbms_utility.format_call_stack, the most detailed information in the callstack is my_pak ... nothing about my_prc.
Below is a test scenario to generate callstack data.
////////////////////////////////////
create or replace package my_pak as
procedure my_prc;
end my_pak;
create or replace package body my_pak as procedure disp_call_stack is
call_stack varchar2(4096) := dbms_utility.format_call_stack; begin
while (length(call_stack) > 0) loop
dbms_output.put_line(substr(call_stack, 1, 255)); call_stack := substr(call_stack, 256);end loop;
disp_call_stack;
end my_prc;
end my_pak;
////////////////////////////////////
begin my_pak.my_prc; end;
Suggestions would be most welcome. Thanks.
![]() |
![]() |