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 -> Debugging PL/SQL

Debugging PL/SQL

From: Mark Adrian Pether <930722_at_bud.swin.edu.au>
Date: 1997/02/11
Message-ID: <5dohor$f2u$1@lucy.swin.edu.au>#1/1

Just a small problem, how does one extract the line number of a program exception. I'm wanting to write a debugging package which launches a procedure/function, but I want to handle the exceptions myself, ie. get exception line number and original source line (from user_source).

SQLCODE, SQLERRM and dbms_utility.format_error_stack don't produce line number. Even if I have to trap some standard error or something and pull it apart token by token, there must be a way.

Heres a demo of what code would do:

 declare
   procedure a is
     b number;
   begin
     b:= 9/0;
   end a;
 begin
   a;
 exception
   when others then

     display_lineno;     ===> would print 5
     display_sourceline; ===> would print b:= 9/0;
     display_errormess;  ===> print exception DIVIDE_BY_ZERO...
 end;

I'm using Oracle v7.2 (PL v2.2), can I do the above?

Any help greatly appreciated. Received on Tue Feb 11 1997 - 00:00:00 CST

Original text of this message

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