Contents|Index|Previous|Next

SQLSetScrollOptions Mapping

When an application calls SQLSetScrollOptions through an ODBC 3.0 driver, and the driver does not support SQLSetScrollOptions, the call to:

SQLSetScrollOptions (StatementHandle, Concurrency, KeysetSize, RowsetSize)

will result in:

1. A call to:

SQLGetInfo (ConnectionHandle, InfoType, InfoValuePtr, BufferLength, StringLengthPtr)

with the InfoType argument set to one of the following values, depending on the value of the KeysetSize argument in SQLSetScrollOptions:

KeysetSize argument
InfoType argument
SQL_SCROLL_FORWARD_ONLY
SQL_FORWARD_ONLY_CURSOR_
ATTRIBUTES2
SQL_SCROLL_STATIC
SQL_STATIC_CURSOR_
ATTRIBUTES2
SQL_SCROLL_KEYSET_DRIVEN
SQL_KEYSET_CURSOR_
ATTRIBUTES2
SQL_SCROLL_DYNAMIC
SQL_DYNAMIC_CURSOR_
ATTRIBUTES2
A value greater than the RowsetSize argument
SQL_KEYSET_CURSOR_
ATTRIBUTES2

If the value of the KeysetSize argument is not listed in the previous table, the call to SQLSetScrollOptions returns SQLSTATE S1107 (Row value out of range), and none of the following steps are performed.

The Driver Manager then verifies whether the appropriate bit is set in the *InfoValuePtr value returned by the call to SQLGetInfo, according to the value of the Concurrency argument in SQLSetScrollOptions:

Concurrency argument
InfoType setting
SQL_CONCUR_READ_ONLY
SQL_CA2_READ_ONLY_
CONCURRENCY
SQL_CONCUR_LOCK
SQL_CA2_LOCK_CONCURRENCY
SQL_CONCUR_ROWVER
SQL_CA2_ROWVER_
CONCURRENCY
SQL_CONCUR_VALUES
SQL_CA2_VALUES_CONCURRENCY

If the Concurrency argument is not one of the values in the previous table, the call to SQLSetScrollOptions returns SQLSTATE S1108 (Concurrency option out of range), and none of the following steps are performed. If the appropriate bit (as indicated in the previous table) is not set in *InfoValuePtr to one of the values corresponding to the Concurrency argument, the call to SQLSetScrollOptions returns SQLSTATE S1C00 (Driver not capable) and none of the following steps are performed.

2. A call to:

SQLSetStmtAttr (StatementHandle, SQL_ATTR_CURSOR_TYPE, ValuePtr, 0)

with *ValuePtr set to one of the following values, according to the value of the KeysetSize argument in SQLSetScrollOptions:

KeysetSize argument
*ValuePtr
SQL_SCROLL_FORWARD_ONLY
SQL_CURSOR_FORWARD_ONLY
SQL_SCROLL_STATIC
SQL_CURSOR_STATIC
SQL_SCROLL_KEYSET_DRIVEN
SQL_CURSOR_KEYSET_DRIVEN
SQL_SCROLL_DYNAMIC
SQL_CURSOR_DYNAMIC
A value greater than the RowsetSize argument
SQL_CURSOR_KEYSET_DRIVEN

3. A call to:

SQLSetStmtAttr (StatementHandle, SQL_ATTR_CONCURRENCY, ValuePtr, 0)

with *ValuePtr set to the Concurrency argument in SQLSetScrollOptions.

4. If the KeysetSize argument in the call to SQLSetScrollOptions is positive, a call to:

SQLSetStmtAttr (StatementHandle, SQL_ATTR_KEYSET_SIZE, ValuePtr, 0)

with *ValuePtr set to the KeysetSize argument in SQLSetScrollOptions.

5. A call to:

SQLSetStmtAttr (StatementHandle, SQL_ROWSET_SIZE, ValuePtr, 0)

with *ValuePtr set to the RowsetSize argument in SQLSetScrollOptions.

Note When the Driver Manager maps SQLSetScrollOptions for an application working with an ODBC 3.0 driver that does not support SQLSetScrollOptions, the Driver Manager sets the SQL_ROWSET_SIZE statement option, not the SQL_ATTR_ROW_ARRAY_SIZE statement attribute, to the RowsetSize argument in SQLSetScrollOption. As a result, SQLSetScrollOptions cannot be used by an application when fetching multiple rows by a call to SQLFetch or SQLFetchScroll. It can only be used when fetching multiple rows by a call to SQLExtendedFetch.