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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Line number in a stored procedure or function

Re: Line number in a stored procedure or function

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Wed, 15 Dec 1999 21:53:02 +0100
Message-ID: <945291238.17953.0.pluto.d4ee154e@news.demon.nl>


I tried using dbms_utility.format_error_stack, but that seems to pose = the same problem.
The only thing I came up with is not to handle any error with = exceptions. The numbers shown by the default error handler ARE correct. So I'll second this motion...

Regards,

--
Sybrand Bakker, Oracle DBA
  Marc Weinsock <MWeinstock_at_lds.com> wrote in message = news:3857FCDC.82B55D0B_at_lds.com...
  When using raise_application_error() function in an exception clause, = does anyone know how to show the exact line number where the error = happened. In the following I want to see line number 4 not line number = 8.     

  SQL> create table temp (
    2 col1 varchar2(1));

  Table created.

  SQL> 
  SQL> 
  SQL> CREATE OR REPLACE procedure test is 
    2      c_err_msg       varchar2(100); 
    3
    3 BEGIN
    4 insert into temp(col1) values ('12345');     5
    5 EXCEPTION
    6      when OTHERS then 
    7      c_err_msg := sqlerrm; 
    8      raise_application_error(-20000,c_err_msg); 
    9 END;
   10 /

  Procedure created.

  SQL>
  SQL> execute test
  begin test; end;

  *
  ERROR at line 1:

  ORA-20000: ORA-01401: inserted value too large for column 
  ORA-06512: at "WS_DEV.TEST", line 8 
  ORA-06512: at line 1 
    

  SQL>
  SQL>   --

  =
==========================
====================== 

  Marc Weinstock
  Logical design Solutions

  55 Broadway - 21st Floor
  New York, New York 10006

  Phone: 800.221.5327 x2136
  Fax: 212-825-2245
  E-Mail: MWeinstock_at_lds.com
  Web: http://www.lds.com      Received on Wed Dec 15 1999 - 14:53:02 CST

Original text of this message

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