Explain different types of cursors?

Different types of cursors:

Implicit cursors:

  • These cursors are invoked implicitly.
  • User need not create, open, fetch or close the cursor.

Explicit cursors:

  • These cursors are not invoked implicitly.
  • User needs to create, open, fetch or close the cursor.

Static Cursor:

  • Stores a complete copy of the result set.
  • Used mostly where scrolling is required.
  • Static cursors don’t support updates.

Forward - only cursors:

  • This cursor supports updates but not scrolling.
  • It supports only fetching serially.
  • Rows are not retrieved from the database until they are fetched. 

Forward - only cursors / Read only cursor:

  • These are the fastest of the cursors and cannot be updated.
  • They cannot be created on query that returns only read only columns.

Key set driven:

  • It is a scrollable cursor that cannot be updated. These cursors are controlled  by a set of physical identifiers called as key set. 
  • The keyset is built in a  temporary table when the cursor is opened.