Wednesday, 4 September 2013

DB2 Cursor Type

A cursor provides a way to access a result table. The cursor is used to maintain a position in the result table. SQL uses a cursor to work with the rows in the result table and make them available to the program.
Cursor were broadly divided into two category. Refer below figure.

  • Scrollable Cursor : provide ability to scroll forward and backward through data in an application program, no additional host language code is required to move forward or backward through the result set of a SELECT statement. 
  • Serial Cursor : Normal Cursor or Serial Cursor data can only be accessed one row at a time in a forward direction using the FETCH statement. 
Note : The SCROLL keyword is used to specify a cursor as a scrollable cursor.

Created with Artisteer

1 comment:

  1. Check out the mainframe blog