Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_UTILITY.FORMAT_ERROR_BACKTRACE issue

Re: DBMS_UTILITY.FORMAT_ERROR_BACKTRACE issue

From: Ziad <zarabo_at_gmail.com>
Date: 2 May 2007 07:22:28 -0700
Message-ID: <1178115748.158223.127440@n59g2000hsh.googlegroups.com>


ok guys, how can you explain this. I added a wrapper procedure that calls my test procedure, and moved the exception when others to the new wrapper procedure. Now, the backtrace gives me the extact line number where the error happened.
Very weird.

CREATE OR REPLACE package body za_test is

procedure test is

cursor c is
select 1
from dual;

v_1 varchar2(1);

begin

 for r in c loop

   v_1 := '3333333'; -- line 15
 end loop;

end test;

procedure wrapper is

begin

  za_test.test;
exception when others then

      dbms_output.put_line('sqlerrm: '||SQLERRM);
      dbms_output.put_line('backtrace: '||
DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
end wrapper;

end za_test;
/

exec za_test.wrapper

sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
backtrace: ORA-06512: at "ZA_TEST", line 15 ORA-06512: at "ZA_TEST", line 25 Received on Wed May 02 2007 - 09:22:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US