Begin detailed description.

This figure shows the resulting cursor position after five calls to SQLFetchScroll(), when the rowset size is 3, and the result set size is n.

The following table describes the SQLFetchScroll() calls that are made, and the result of each call.
SQLFetchScroll() invocation number FetchOrientation value FetchOffset value Cursor position before SQLFetchScroll Rows retrieved Explanation
1 SQL_FETCH_LAST None n-3 n-2, n-1, n SQL_FETCH_LAST positions the cursor three rows before the end of the result set.
2 SQL_FETCH_FIRST None 1 1, 2, 3 SQL_FETCH_FIRST positions the cursor at the beginning of the result set.
3 SQL_FETCH_NEXT None 4 4, 5, 6 SQL_FETCH_NEXT positions the cursor after the previous rowset.
4 SQL_FETCH_RELATIVE -1 3 3, 4, 5 SQL_FETCH_RELATIVE with a FetchOffset value of 1 positions the cursor one row before the beginning of the previous rowset.
5 SQL_FETCH_ABSOLUTE 11 10 10, 11, 12 SQL_FETCH_ABSOLUTE with a FetchOffset value of 11 positions the cursor at 11 rows from the beginning of the result set.

End detailed description.