Result sets in CLI applications
A result set is the
complete set of rows that satisfy an SQL SELECT statement. You use
a fetch statement to retrieve rows from the result set to populate
the row set.
The following terms describe result handling:
- rowset
- The subset of rows from the result set that is returned after
each fetch. The application indicates the size of the rowset before
the first fetch of data, and can modify the size before each subsequent
fetch. Each call to
SQLFetch()
,SQLFetchScroll()
, orSQLExtendedFetch()
populates the rowset with the appropriate rows from the result set. - bookmark
- It is possible to store a reference to a specific row in the result
set called a bookmark. Once stored, the application can continue to
move through the result set, then return to the bookmarked row to
generate a rowset. You can also use a bookmark to perform updates
and deletions with
SQLBulkOperations()
. - keyset
- A set of key values used to identify the set and order of rows that are included in a keyset-driven cursor. The keyset is created when a keyset-driven cursor is first opened. As the cursor scrolls through the result set, it uses the keys in the keyset to retrieve the current data values for each row.
The following figure demonstrates the relationship between result
set, rowset, bookmark, and keyset: 
