SunQuest
 
       Oracle
  Home arrow Oracle arrow Page 2 - Database Interaction with PL/SQL, Intr...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Database Interaction with PL/SQL, Introduction to Cursors, Implicit Cursors
By: Jagadish Chatarji
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 34
    2005-07-19

    Table of Contents:
  • Database Interaction with PL/SQL, Introduction to Cursors, Implicit Cursors
  • Introduction to Cursors
  • The powerful SQL cursor
  • %NOTFOUND, %ROWCOUNT and %ISOPEN attributes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Database Interaction with PL/SQL, Introduction to Cursors, Implicit Cursors - Introduction to Cursors


    (Page 2 of 4 )

    This concept is the heart of PL/SQL programming. First of all, this concept is very easy; it is not at all complicated in any sense. Those who are familiar with Visual Basic 6 can just imagine a cursor as a recordset, or "datatable" in .NET (or resultset in java). A cursor can be understood as a pointer (or reference) to a memory area which holds the result of any SQL query. Actually, we already used the concept of cursor (unknowingly) in the section "A Powerful FOR loop in PL/SQL" of part five in this series.

    Basically, there exist two types of cursors, IMPLICIT and EXPLICIT cursors. IMPLICIT cursors do not have any declarations. They will be automatically created and lost within the memory. We will not have any control over the IMPLICIT cursors. A FOR loop with a SELECT statement, internally maintains an IMPLICIT cursor in memory which is removed from memory once the loop gets completed (an example is available in part five of this series).

    We can identify the status of any cursor by using a set of cursor ATTRIBUTES. These ATTRIBUTES can be used with named cursors only (we will look into this later). These ATTRIBUTES play a very important role in dealing with cursors. The following is the list of ATTRIBUTES used with cursors.

    • %FOUND
    • %NOTFOUND
    • %ROWCOUNT
    • %ISOPEN

    The above are just some basic attributes. Oracle 9i and 10g introduced a few more. But I will look into them only in upcoming articles, as they will be used in different contexts, other than just a simple cursor. I would like to explain each of the above using examples rather than just messy paragraphs.

    More Oracle Articles
    More By Jagadish Chatarji


       · Hello guys, this is my article on cursos and implicit cursors in PL/SQL. You can...
       · Hello guys, this is my article on cursos and implicit cursors in PL/SQL. You can...
     

       

    ORACLE ARTICLES

    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway