你可能想要
原文链接:https://www.f2er.com/oracle/205911.htmlDBMS_UTILITY.FORMAT_ERROR_BACKTRACE
功能
sql> ed Wrote file afiedt.buf 1 create or replace procedure p1 2 is 3 begin 4 raise_application_error( -20001,'Error 1',true ); 5* end; sql> / Procedure created. sql> create or replace procedure p2 2 as 3 begin 4 null; 5 p1; 6 end; 7 / Procedure created. sql> begin 2 p2; 3 exception 4 when others then 5 dbms_output.put_line( dbms_utility.format_error_backtrace ); 6 end; 7 / ORA-06512: at "SCOTT.P1",line 4 ORA-06512: at "SCOTT.P2",line 5 ORA-06512: at line 2 PL/sql procedure successfully completed.