DB2 9 - Life cycle of Cursors On IBM Mainframe DB2

CURSORS
A Select Query can retrieve one too many records, if the query results one record, it is good to capture the result and manipulate it. But the same select query used in same program retrieves more than one row at a time, it abends with SQL-CODE= -81.  To handle this issue we go for  CURSORS.

CURSORS : 
It is used to retrieve Multiple rows.


Life Cycle of a CURSOR will be same like a File Operations.
  1. Declaration of a Cursor
  2. Open a CURSOR
  3. FETCH CURSOR
  4. CLOSE CURSOR
For More Details click on below video.


Previous
Next Post »