Path: news.easynews.com!easynews!cyclone.swbell.net!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!drn
From: Thomas Kyte <tkyte@oracle.com>
Newsgroups: comp.databases.oracle.tools
Subject: Re: PL-SQL: Exception NO_DATA_FOUND or %NOTFOUND
Date: 7 Jul 2002 10:28:42 -0700
Organization: Oracle
Lines: 67
Message-ID: <ag9toa02fqn@drn.newsguy.com>
References: <3d259174$1@news.wau.nl> <uifqjapc3uhu5d@corp.supernews.com> <ag9gtj01gbh@drn.newsguy.com> <felgiucddh36binb023b8amh786usmm6s8@4ax.com>
NNTP-Posting-Host: p-675.newsdawg.com
X-Newsreader: Direct Read News 2.96
Xref: easynews comp.databases.oracle.tools:52265
X-Received-Date: Sun, 07 Jul 2002 10:49:12 MST (news.easynews.com)

In article <felgiucddh36binb023b8amh786usmm6s8@4ax.com>, Sybrand says...
>
>On 7 Jul 2002 06:49:39 -0700, Thomas Kyte <tkyte@oracle.com> wrote:
>
>>incorrect.
>>
>>   open c;
>>   fetch c into ...;
>>   if c%notfound then .....
>>
>>the above code makes sense and properly detects the no data found condition
>>whereas:
>>
>>   open c;
>>   begin
>>      fetch c into ...;
>>   exception
>>      when no_data_found then .....
>>   end;
>>
>>won't "work" -- it's a bug in the code.  It'll never ever detect that "no data
>>was found" since the no_data_found exception is raised only when you use a
>>SELECT INTO.
>
>
>I did differentiate between exception and condition, did I? I never
>said a FETCH INTO raises the NO_DATA_FOUND exception, did I?
>Maybe I shouldn't have used the phrase 'raise condition'
>You could also argue about 'night and day different'

You said 

<quote>
Basically there is no difference.
The no_data_found exception is raised when using implicit cursors.
The no_data_found condition is raised when using explicit cursors, you
always need to handle those.
</quote>

I see it now -- you called it a no_data_found condition, that's what tripped me
up.  There is a no_data_found exception -- and a %NOTFOUND condition.  It was
the use of no_data_found along with the word "raised" with explicit cursors --
conditions aren't really raised, exceptions are and there isn't really a
condition no_data_found.

sorry for the confusion on that.

>In *both* cases sqlnet on the client side receives the ora-1403 error
>message. And it has always mightily suprised me error messages are
>being sent from server to client *in full*, as you will *always* get
>ora-1403, either expected or unexpected. Looks a waste of resources to
>me. But then we are probably both nitpicking.
>
>Regards
>
>
>
>Sybrand Bakker, Senior Oracle DBA
>
>To reply remove -verwijderdit from my e-mail address

--
Thomas Kyte (tkyte@oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 

