version 2004
ODBC_SQLSetStmtAttr (stmtID; attribute; valuePtr) Longint
| Parameter | Type | Description | |
| stmtID | Longint | Statement ID | |
| attribute | Longint | Attribute to set | |
| valuePtr | Pointer | Pointer to the value to set the attribute | |
| Function result | Longint | Returns the result of the MS ODBC API function | |
| SQLSetStmtAttr |
Description
The ODBC_SQLSetStmtAttr command sets attribute related to a statement.
stmtID is a valid statement ID returned by ODBC_SQLAllocStmt.
attribute is a statement attribute to set and can be one of the following values:
| Constant | Description |
| SQL_ATTR_APP_PARAM_DESC | |
| SQL_ATTR_APP_ROW_DESC | |
| SQL_ATTR_ASYNC_ENABLE | Specifies whether a function called with the |
| specified statement is executed asynchronously | |
| SQL_ATTR_CONCURRENCY | Specifies the cursor concurrency |
| SQL_ATTR_CURSOR_SCROLLABLE | Scrollable cursors are either required or not |
| required for the specified statement | |
| SQL_ATTR_CURSOR_SENSITIVITY | Specifies whether cursors for the specified |
| statement handle make visible the changes | |
| made to a result set by another cursor | |
| SQL_ATTR_CURSOR_TYPE | Specifies cursor type, like scrolls forward, static, |
| saves and uses the keys for the number of | |
| specified rows specified or only those in the | |
| rowset | |
| SQL_ATTR_ENABLE_AUTO_IPD | SQL_TRUE = Turns on automatic population of |
| the IPD after a call to ODBC_SQLPrepare. | |
| SQL_FALSE = Turns off automatic population of | |
| the IPD after a call to ODBC_SQLPrepare. | |
| SQL_ATTR_FETCH_BOOKMARK_PTR | Bookmark value |
| SQL_ATTR_IMP_PARAM_DESC | The value of this attribute is the descriptor |
| allocated when the statement was initially | |
| allocated. | |
| SQL_ATTR_IMP_ROW_DESC | The value of this attribute is the descriptor |
| allocated when the statement was initially | |
| allocated. | |
| SQL_ATTR_KEYSET_SIZE | Number of rows in the keyset for a keyset- |
| driven cursor | |
| SQL_ATTR_MAX_LENGTH | Maximum amount of data that the driver |
| returns from a character or binary column. | |
| SQL_ATTR_MAX_ROWS | Maximum number of rows to return to the |
| application for a SELECT statement. | |
| SQL_ATTR_METADATA_ID | Determines how the string arguments of catalog |
| functions are treated. | |
| SQL_ATTR_NOSCAN | Indicates whether the driver should scan SQL |
| strings for escape sequences. | |
| SQL_ATTR_PARAM_BIND_OFFSET_PTR | Bind offset. |
| SQL_ATTR_PARAM_BIND_TYPE | Indicates the binding orientation to be used for |
| dynamic parameters. | |
| SQL_ATTR_PARAM_OPERATION_PTR | Indicates if a parameter is to be ignored during |
| execution of an SQL statement. | |
| SQL_ATTR_PARAM_STATUS_PTR | Status information for each row of parameter |
| values. | |
| SQL_ATTR_PARAMS_PROCESSED_PTR | Number of sets of parameters that have been |
| processed, including error sets. | |
| SQL_ATTR_PARAMSET_SIZE | Specifies the number of values for each parameter. |
| SQL_ATTR_QUERY_TIMEOUT | Number of seconds to wait for an SQL |
| statement to execute. | |
| SQL_ATTR_RETRIEVE_DATA | Either retrieve or do not retrieve data after it |
| positions the cursor to the specified location. | |
| SQL_ATTR_ROW_ARRAY_SIZE | Number of rows returned by each call to |
| ODBC_SQLFetch or ODBC_SQLFetchScroll | |
| SQL_ATTR_ROW_BIND_OFFSET_PTR | An offset to change binding of column data. |
| SQL_ATTR_ROW_BIND_TYPE | The binding orientation to be used when |
| ODBC_SQLFetch or ODBC_SQLFetchScroll is | |
| called on the specified statement. | |
| SQL_ATTR_ROW_NUMBER | Number of the current row in the entire result set. |
| SQL_ATTR_ROW_OPERATION_PTR | Values used to ignore a row during a bulk |
| operation using ODBC_SQLSetPos. | |
| SQL_ATTR_ROW_STATUS_PTR | Row status values after a call to ODBC_SQLFetch |
| or ODBC_SQLFetchScroll. | |
| SQL_ATTR_ROWS_FETCHED_PTR | Number of rows fetched after a call to |
| ODBC_SQLFetch or ODBC_SQLFetchScroll. | |
| SQL_ATTR_SIMULATE_CURSOR | Specifies whether drivers that simulate |
| positioned update and delete statements | |
| guarantee that such statements affect only one | |
| single row. | |
| SQL_ATTR_USE_BOOKMARKS | Specifies whether an application will use |
| bookmarks with a cursor. |
valuePtr is a pointer to a variable containing the value at which to set the attribute parameter.
For more information, please see the SQLSetStmtAttr function in the MS ODBC API at http://msdn.microsoft.com/library/en-us/odbc/htm/odbcsqlsetstmtattr.asp.
Function Results
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.
Example
See the example for the ODBC_SQLBulkOperations command.
See Also
ODBC_SQLBulkOperations, ODBC_SQLGetStmtAttr.