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 -> Dbms_Utility.format_error_stack only returns 1st error !?

Dbms_Utility.format_error_stack only returns 1st error !?

From: Karl E. Jørgensen <kjorg_at_msn.com>
Date: 1997/12/13
Message-ID: <#DhZnA2B9GA.237@upnetnews04>#1/1

This is a multi-part message in MIME format.

------=_NextPart_000_00A7_01BD075F.F85BDF60 Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Initially I'd have thought that the DBMS_UTILITY.FORMAT_ERROR_STACK = function returned "the error stack" !

So, If I have a procedure (which calls loads of other procedures) and = want the CALLING procedure to report any errors, I expected to be able = to just "catch" it in a "when others" exception, then use = format_error_stack to report the error, and continue processing.

In short, this is driving me nuts (some may say that's too late anyway), = but am I missing something obvious ? Or am I just (heaven forbid !) = WRONG ? I'd appreciate any suggestions you may have

Karl

### Good - this was what I expected.
### Now try to catch it in an exception
=20
SQL> Begin
  2 proc_a;
  3 Exception When others Then
  4 DBMS_Output.Put_Line(DBMS_Utility.format_error_stack);   5 End;
  6 /
ORA-01403: no data found
=20
=20
PL/SQL procedure successfully completed.

###' yep - I caught it. BUT WHERE IS THE REST OF THE ERROR STACK !?=20 SQL> ------=_NextPart_000_00A7_01BD075F.F85BDF60 Content-Type: text/html;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Initially I'd have thought that the=20
DBMS_UTILITY.FORMAT_ERROR_STACK function returned &quot;the error = stack&quot;=20
!</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>So, If I have a procedure (which calls loads of =
other=20
procedures) and want the CALLING procedure to report any errors, I = expected to=20
be able to just &quot;catch&quot; it in a &quot;when others&quot; = exception,=20
then use format_error_stack to report the error, and continue=20 processing.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>In short, this is driving me nuts (some may say =
that's too=20
late anyway), but am I missing something obvious ? Or am I just (heaven = forbid=20
!) WRONG ?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I'd appreciate any suggestions you =
may=20
have</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Karl</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>--- Sample SQL*Plus =
output</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>SQL&gt; create or replace Procedure =
proc_c=20
Is<BR>&nbsp; 2&nbsp; Begin<BR>&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; raise=20 no_data_found;<BR>&nbsp; 4&nbsp; End proc_c;<BR>&nbsp; 5&nbsp; = /<BR>Procedure=20
created.<BR>SQL&gt; create or replace Procedure proc_b Is<BR>&nbsp; = 2&nbsp;=20
Begin<BR>&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; proc_c;<BR>&nbsp; 4&nbsp; End=20 proc_b;<BR>&nbsp; 5&nbsp; /<BR>Procedure created.<BR>SQL&gt; create or = replace=20
Procedure proc_a Is<BR>&nbsp; 2&nbsp; Begin<BR>&nbsp; = 3&nbsp;&nbsp;&nbsp;&nbsp;=20
proc_b;<BR>&nbsp; 4&nbsp; End proc_a;<BR>&nbsp; 5&nbsp; /<BR>Procedure=20 created.<BR>SQL&gt; Begin<BR>&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; = proc_a;<BR>&nbsp;=20
3&nbsp; End;<BR>&nbsp; 4&nbsp; /<BR>Begin<BR>&nbsp;*<BR>ERROR at line=20 1:<BR>ORA-01403: no data found<BR>ORA-06512: at = &quot;SCOTT.PROC_C&quot;, line=20
3<BR>ORA-06512: at &quot;SCOTT.PROC_B&quot;, line 3<BR>ORA-06512: at=20 &quot;SCOTT.PROC_A&quot;, line 3<BR>ORA-06512: at line = 2<BR></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>### Good - this was what I=20
expected.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>### Now try to catch it in an=20
exception<BR>&nbsp;<BR>SQL&gt; Begin<BR>&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; =

proc_a;<BR>&nbsp; 3&nbsp; Exception When others Then<BR>&nbsp;=20 4&nbsp;&nbsp;&nbsp;&nbsp;=20
DBMS_Output.Put_Line(DBMS_Utility.format_error_stack);<BR>&nbsp; 5&nbsp; =

End;<BR>&nbsp; 6&nbsp; /<BR>ORA-01403: no data=20 found<BR>&nbsp;<BR>&nbsp;<BR>PL/SQL procedure successfully=20 completed.<BR></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>###' yep - I caught it. BUT WHERE IS =
THE REST OF=20
THE ERROR STACK !? <BR>SQL&gt;</FONT></DIV></BODY></HTML>

------=_NextPart_000_00A7_01BD075F.F85BDF60-- Received on Sat Dec 13 1997 - 00:00:00 CST

Original text of this message

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