CURSORS IN DB2
Use of DB2 Cursors in Application Program
- Mechanism that allows the SELECT statement to find a set of rows from table
- It return rows one at a time
- Used as similar to a File which can be Opened, Read and Closed
- ‘Fetch’ terminology is used instead of ‘Read’
- Can be declared in both ‘Working Storage’ and ‘Procedure Division’
- Should always be declared before the ‘Open’ Cursor statement
Types of Cursors
- Row Positioned Cursor- RowSet Positioned Cursor
- Scrollable
- Non Scrollable
- Held
- Non-Held
- Returnable
- Non-Returnable