CREATE OR REPLACE PACKAGE pkg1 AUTHID DEFINER
IS
PROCEDURE proc1;
END pkg1;
Package created.
Down to Subprogram Name!
CREATE OR REPLACE PACKAGE BODY pkg1
IS
PROCEDURE proc1
IS
PROCEDURE nested_in_proc1
IS
BEGIN
DBMS_OUTPUT.put_line (
'*** "Traditional" Call Stack using FORMAT_CALL_STACK');
DBMS_OUTPUT.put_line (DBMS_UTILITY.format_call_stack);
DBMS_OUTPUT.put_line (
'*** Fully Qualified Nested Subprogram vis UTL_CALL_STACK');
DBMS_OUTPUT.put_line (
utl_call_stack.concatenate_subprogram (
utl_call_stack.subprogram (1)));
END;
BEGIN
nested_in_proc1;
END;
END pkg1;
Package Body created.
The Call Stack Output
BEGIN
pkg1.proc1;
END;
*** "Traditional" Call Stack using FORMAT_CALL_STACK
----- PL/SQL Call Stack ----- object line frame object handle number size name 0x40706e6b8 11 416 package body SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PKG1.PROC1.NESTED_IN_PROC1 0x40706e6b8 21 24 package body SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PKG1.PROC1 0x20c994d60 2 24 anonymous block 0x45612b8e0 1721 88 package body SYS.DBMS_SQL.EXECUTE 0x465ed06e0 1365 4848 package body LIVESQL.ORACLE_SQL_EXEC.RUN_BLOCK 0x465ed06e0 1459 960 package body LIVESQL.ORACLE_SQL_EXEC.RUN_SQL 0x465ed06e0 1574 464 package body LIVESQL.ORACLE_SQL_EXEC.RUN_A_STATEMENT 0x465ed06e0 1898 5008 package body LIVESQL.ORACLE_SQL_EXEC.RUN_STATEMENTS 0x465ed06e0 2015 2528 package body LIVESQL.ORACLE_SQL_EXEC.RUN_STMTS 0x46e789230 2512 3712 package body LIVESQL.ORACLE_SQL_SCHEMA.RUN_SAVED_SESSION 0x45e286e48 341 112 package body LIVESQL.ORACLE_SQL_SCHEMA_PUB.RUN_SAVED_SESSION 0x407bde178 22 1616 anonymous block 0x45612b8e0 1721 88 package body SYS.DBMS_SQL.EXECUTE 0x417207590 1880 936 package body APEX_050100.WWV_FLOW_DYNAMIC_EXEC.RUN_BLOCK5 0x417207590 936 168 package body APEX_050100.WWV_FLOW_DYNAMIC_EXEC.EXECUTE_PLSQL_CODE 0x4858d9a38 71 256 package body APEX_050100.WWV_FLOW_PROCESS_NATIVE.PLSQL 0x4858d9a38 1132 4544 package body APEX_050100.WWV_FLOW_PROCESS_NATIVE.EXECUTE_PROCESS 0x466594bf0 2399 2744 package body APEX_050100.WWV_FLOW_PLUGIN.EXECUTE_PROCESS 0x46eabb2d0 200 2376 package body APEX_050100.WWV_FLOW_PROCESS.PERFORM_PROCESS 0x46eabb2d0 443 11744 package body APEX_050100.WWV_FLOW_PROCESS.PERFORM 0x4562256d0 4857 40 package body APEX_050100.WWV_FLOW.SHOW.RUN_BEFORE_HEADER_CODE 0x
*** Fully Qualified Nested Subprogram vis UTL_CALL_STACK
PKG1.PROC1.NESTED_IN_PROC1
Backtrace Info, Too!
CREATE OR REPLACE FUNCTION backtrace_to
RETURN VARCHAR2 AUTHID DEFINER
IS
BEGIN
RETURN
utl_call_stack.backtrace_unit (
utl_call_stack.backtrace_depth)
|| ' line '
|| utl_call_stack.backtrace_line (
utl_call_stack.backtrace_depth);
END;
Function created.
CREATE OR REPLACE PACKAGE pkg1 AUTHID DEFINER
IS
PROCEDURE proc1;
PROCEDURE proc2;
END;
Package created.
CREATE OR REPLACE PACKAGE BODY pkg1
IS
PROCEDURE proc1
IS
PROCEDURE nested_in_proc1
IS
BEGIN
RAISE VALUE_ERROR;
END;
BEGIN
nested_in_proc1;
END;
PROCEDURE proc2
IS
BEGIN
proc1;
EXCEPTION
WHEN OTHERS
THEN
RAISE NO_DATA_FOUND;
END;
END pkg1;
Package Body created.
CREATE OR REPLACE PROCEDURE proc3 AUTHID DEFINER
IS
BEGIN
pkg1.proc2;
END;
Procedure created.
BEGIN
proc3;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (backtrace_to);
END;
ORA-64610: bad depth indicator ORA-06512: at "SYS.UTL_CALL_STACK", line 180 ORA-06512: at "SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.BACKTRACE_TO", line 5 ORA-06512: at line 6 ORA-06512: at "SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PKG1", line 21 ORA-06512: at "SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PKG1", line 8 ORA-06512: at "SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PKG1", line 11 ORA-06512: at "SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PKG1", line 17 ORA-06512: at "SQL_RHMNFZMBVXMXUDWPPFNBLLUVE.PROC3", line 4 ORA-06512: at line 2 ORA-06512: at "SYS.DBMS_SQL", line 1721More Details: https://docs.oracle.com/error-help/db/ora-64610