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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Getting line number of exception

Re: Getting line number of exception

From: Big H <ihwh_at_iname.com>
Date: Sat, 16 Sep 2000 00:12:39 +0200
Message-ID: <8pu75v$5du$1@nereid.worldonline.nl>

Hi Amy,

I'm not sure that an exception handler will do that for you in PL/SQL. But you may define your own exceptions to occur and raise them 'at will'. For examlpe you calculate or count in a program the number of items in stock.
When the number exceeds 1,000 (as the amount will be entered by a parson who may mistype ;-) ) you should stop processing and log an error. You could declare an exception for that.

DECLARE
  more_than_1000 EXCEPTION;
BEGIN
  /* your cursor loop stuff */
  IF item_count > 1000
    THEN RAISE more_than_1000;
EXCEPTION
  WHEN more_than_1000

     THEN /* do your exception stuff */
END; This will not only tell you what the error is but also handle that error for you.
It is explained in the manual under EXCEPTION_INIT and EXCEPTION.

Good luck and kind regards,

H.

"Amy Schmieder" <aschmied_at_earthlink.net> schreef in bericht news:8prpk5$53p$1_at_nnrp1.deja.com...
> Greetings all,
>
> I am trying to write out a log of exceptions that occur. I would
> really like to include what line number the exception was raised at
> (especially for when others!), but I have been unable to track down
> what will get me that piece of information. If anybody knows that, I
> would be grateful!
>
> Thanks
> Amy Schmieder
> amys_at_rentals.com
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Sep 15 2000 - 17:12:39 CDT

Original text of this message

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