Re: PL-SQL: Exception NO_DATA_FOUND or %NOTFOUND

From: tojo <TomJordanTojo_at_hotmail.com>
Date: Fri, 5 Jul 2002 15:01:26 +0200
Message-ID: <MPG.178fb7126baa24d4989699_at_news.t-online.de>


In article <3d259174$1_at_news.wau.nl>, hhu_at_stopspam.stoas.nl says...
> Hi,
>
> Does anyone know if there is a difference between:
>
> OPEN <cursor>;
> FETCH <cursor> INTO <variable>;
> EXCEPTION
> WHEN NO_DATA_FOUND THEN
> ....
>
> and
>
> OPEN <cursor>;
> FETCH <cursor> INTO <variable>;
> WHEN <cursor>%NOTFOUND THEN
> ....
>
> I remember having heard that thers IS a difference; however I can't find it
> in the manuals.
>

FETCH will not throw NO_DATA_FOUND if there's no more data in the cursor, so you have to use %NOTFOUND as in your 2nd example. NO_DATA_FOUND will be thrown when SELECTing INTO.

  • Tom
Received on Fri Jul 05 2002 - 15:01:26 CEST

Original text of this message