GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 34 of 171    Print  
Difference between NO DATA FOUND and %NOTFOUND
NO DATA FOUND is an exception raised only for the SELECT....INTO statements when the where clause of the querydoes not match any rows. When the where clause of the explicit cursor does not match any rows the %NOTFOUND attribute is set to TRUE instead.



  
Total Answers and Comments: 3 Last Update: February 06, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: syam sundar
 
NO DATA FOUND is an exception

When your SELECT INTO statement returns no rows that time an error raised by oracle. The error is ORA-01403 NO DATA FOUND

Whereas %NOTFOUND is a cursor attribute

It returns true if the cursor does not fetch any row. It checks wether the cursor returns the rows or not. 



Above answer was rated as good by the following members:
rituk_15
July 12, 2006 00:03:22   #1  
Ayan Mahalanabish        

RE: Difference between NO DATA FOUND and %NOTFOUND
NO DATA FOUND is an Exception whereas NOTFOUND is a cursor attribute
 
Is this answer useful? Yes | No
August 17, 2007 08:57:03   #2  
syam sundar        

RE: Difference between NO DATA FOUND and %NOTFOUND
NO DATA FOUND is an exception

When your SELECT INTO statement returns no rows that time an error raised by oracle. The error is ORA-01403 NO DATA FOUND

Whereas NOTFOUND is a cursor attribute

It returns true if the cursor does not fetch any row. It checks wether the cursor returns the rows or not.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
February 06, 2008 14:56:46   #3  
g_sidhu Member Since: August 2007   Contribution: 122    

RE: Difference between NO DATA FOUND and %NOTFOUND

NO DATA FOUND: Is an exception which is raised when no rows are retrieved from the database in a SELECT statement then PL/SQL raises the exception NO_DATA_FOUND.

NOTFOUND: is a Boolean attribute that evaluates to TRUE if the most recent SQL

statement does not affect any rows.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape