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: Avoiding PL/SQL * NO_DATA_FOUND exception

Re: Avoiding PL/SQL * NO_DATA_FOUND exception

From: Thomas Gaines <Thomas.Gaines_at_noaa.gov>
Date: Fri, 21 Jun 2002 09:57:31 -0600
Message-ID: <3D134CEA.A6936B15@noaa.gov>


Jon -

Raphael is absolutely correct. Creating a subblock inside of your main PL/SQL block is tremendously easy, and it allows for clever suppression of errors that may arise.

For an example of a PL/SQL "main" block that contains a subblock, refer to Oracle technical note 168492.1, "How to Force a PL/SQL Block to Continue Processing After Exception is Raised," or any good Oracle PL/SQL book. Chapter 8 of Steven Feuerstein's "Oracle PL/SQL Programming" comes to mind. The Oracle technical note is available at Metalink.

Thanks,
TG

Raphael Ploix wrote:

> Jon,
>
> just enclose your 'select into' code in an exception handler:
>
> begin
> select ... into ...
> exception
> when no_data_found then
> null; -- or whatever else!
> end;
>
> "Jon" <jzuazoa_at_nexo.es> wrote in message
> news:aeuu6t$shu$1_at_unbe.sarenet.es...
> > Hi,
> >
> > Developing a PL/SQL stored procedure, I would to avoid NO_DATA_FOUND
> > exception but without having to do a SELECT COUNT(*) previously as I am
> > afraid that this is consumes lots of resources. Is there any other way to
> do
> > this task ?
> >
> > Thanks
> >
> >
Received on Fri Jun 21 2002 - 10:57:31 CDT

Original text of this message

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