For Oracle support & training call (800) 766-1884
Free Oracle Tips

Home
Oracle Tips
Oracle Code Depot
Oracle Monitoring
Oracle Consulting
Oracle Training
Oracle News
Oracle Forum
Oracle Support





 

Free Oracle Tips

image

 
HTML Text

Free Oracle App Server Tips

image

 
HTML Text


Privacy Policy

Redneck

Dress Code

Oracle tuning

Oracle training

Oracle support

Remote Oracle


 

   
  Oracle Tips by Burleson

PL/SQL Cursor Attributes

Oracle provides four attributes to get information about the state of a cursor. 

cursor%found    

Returns true if the last fetch returned a new row.  Before the first fetch, %found is null.  After the first fetch, (if it returned a new row) %found is true.  After the first fetch that does not return a new row, %found is false.

cursor%notfound 

Returns true if the last fetch does not return a new row.  The %notfound is basically the opposite of the %found attribute. 

cursor%rowcount 

Returns the number of rows that have already been fetched.  Before the first row, %rowcount is zero.  As each row is fetched, %rowcount increases by one. 

cursor%isopen 

Returns true if the cursor is currently open.    Before the cursor is opened and after the cursor is closed, it returns false.

Note: all the attributes except cursor%isopenwill throw an exception if called before the cursor is opened or after the cursor is closed.

So we have the basics for creating, testing and using a cursor, it is time to put cursors to work.


The above book excerpt is from:

Easy Oracle PL/SQL Programming

Get Started Fast with Working PL/SQL Code Examples

ISBN 0-9759135-7-3   

John Garmany 

http://www.rampant-books.com/book_2005_1_easy_plsql.htm


For more details and scripts, see my new book " Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot.

  
 

 
 
 
 
Oracle performance tuning software
 
 

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

Fast-Track Oracle Support
PO Box 511
Kittrell, NC 27544


Email BC: