Bookmarks in CLI applications
Once you have positioned the cursor to a row in a rowset using SQLSetPos()
,
you can obtain the bookmark value starting from column 0 using SQLGetData()
.
In most cases you will not want to bind column 0 and retrieve the
bookmark value for every row, but use SQLGetData()
to
retrieve the bookmark value for the specific row you require.
A bookmark is only valid within the result set in which it was created. The bookmark value will be different if you select the same row from the same result set in two different cursors.
The only valid comparison is a byte-by-byte comparison between two bookmark values obtained from the same result set. If they are the same then they both point to the same row. Any other mathematical calculations or comparisons between bookmarks will not provide any useful information. This includes comparing bookmark values within a result set, and between result sets.