Fetch and Update Rowsets (ODBC)
Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)
To fetch and update rowsets
Optionally, call SQLSetStmtAttr with SQL_ROW_ARRAY_SIZE to change the number of rows (R) in the rowset.
Call SQLFetch or SQLFetchScroll to get a rowset.
If bound columns are used, use the data values and data lengths now available in the bound column buffers for the rowset.
If unbound columns are used, for each row call SQLSetPos with SQL_POSITION to set the cursor position; then, for each unbound column:
Call SQLGetData one or more times to get the data for unbound columns after the last bound column of the rowset. Calls to SQLGetData should be in order of increasing column number.
Call SQLGetData multiple times to get data from a text or image column.
Set up any data-at-execution text or image columns.
Call SQLSetPos or SQLBulkOperations to set the cursor position, refresh, update, delete, or add row(s) within the rowset.
If data-at-execution text or image columns are used for an update or add operation, handle them.
Optionally, execute a positioned UPDATE or DELETE statement, specifying the cursor name (available from SQLGetCursorName) and using a different statement handle on the same connection.