15.1.4 About using the ODBC cursor library
Use of the ODBC cursor library provided by Microsoft makes the following functionality available in HADB.
- Organization of this subsection
(1) Scrollable cursors
By specifying SQL_SCROLLABLE in the SQL_ATTR_CURSOR_SCROLLABLE attribute, you can:
-
Use SQLFetchScroll to fetch rowset data
-
Use SQLSetPos to position the cursor at a certain row in the rowset
However, you cannot use SQLSetPos to update the rowset data to the latest state. You also cannot use SQLSetPos to update or delete data in result sets.
(2) Bookmark functionality
You can use the following procedure to acquire a bookmark for the row where the cursor is positioned:
-
Set the SQL_ATTR_USE_BOOKMARKS attribute to SQL_UB_VARIABLE.
-
Use SQLSetPos to position the cursor at the desired row in the rowset.
-
Acquire data from column 0.
Also, by specifying a bookmark in the SQL_ATTR_FETCH_BOOKMARK_PTR attribute, you can specify the bookmark in the first row when executing SQLFetchScroll.