Help Me/Question What Are Cursors In Pl/sql?

krishatg

Content Writer
Cursors are the work area where the oracle engine executes the sql queries. It allows to store and execute the sql queries.The data stored in cursors is known as active dataset.

There are 2 types of cursors:
  • Implicit Cursor: They are open, closed and managed by PL/SQL implicitly without user intervention. It executes the SQL statement automatically.
  • Explicit Cursor: they are accessed and managed by the user. It need to be explicitly opened and closed.
Steps to use cursor:
  • Declare the cursor
  • Open the cursor
  • Fetch the data from the cursor 1 row at a time into a memory variable
  • Process the data held in memory variable
  • Exit from loop after processing is complete
  • Close the cursor.
 
Top