Unit 2
Unit 2
Cursors
Triggers
Assertions
RDBMS
CURSORS
• A cursor is a private set of records
• An Oracle Cursor = VB recordset = JDBC
ResultSet
• Implicit cursors are created for every
query made in Oracle
• Explicit cursors can be declared by a
programmer within PL/SQL.
Cursor
Attributes
• cursorname%ROWCOUNT Rows returned so far
• cursorname%FOUND One or more rows retrieved
• cursorname%NOTFOUND No rows found
• Cursorname%ISOPEN Is the cursor open
Explicit Cursor
Control
• Declare the cursor
• Open the cursor
• Fetch a row
• Test for end of cursor
• Close the cursor