SQLGetStmtAttr() returns the current settings of the specified statement attribute.
These options are set using the SQLSetStmtAttr() function. This function is similar to SQLGetStmtOption(), both functions are supported for compatibility reasons.
SQLRETURN SQLGetStmtAttr( SQLHSTMT hstmt, SQLINTEGER fAttr, SQLPOINTER pvParam, SQLINTEGER bLen, SQLINTEGER *sLen);
Data type | Argument | Use | Description |
---|---|---|---|
SQLHSTMT | hstmt | Input | Statement handle. |
SQLINTEGER | fAttr | Input | Attribute to retrieve. Refer to Table 2 for more information. |
SQLPOINTER | pvParam | Output | Pointer to buffer for requested attribute. |
SQLINTEGER | bLen | Input | Maximum number of bytes to store in pvParam, if the attribute is a character string; otherwise, unused. |
SQLINTEGER * | sLen | Output | Length of output data if the attribute is a character string; otherwise, unused. |
fAttr | Data type | Contents |
---|---|---|
SQL_ATTR_APP_PARAM_DESC | Integer | The descriptor handle used by the application to provide parameter values for this statement handle. |
SQL_ATTR_APP_ROW_DESC | Integer | The descriptor handle for the application to retrieve row data using the statement handle. |
SQL_ATTR_CURSOR_SCROLLABLE | Integer | A 32-bit integer value that specifies if
cursors opened for this statement handle should be scrollable.
|
SQL_ATTR_CURSOR_TYPE | Integer | A 32-bit integer value that specifies the
behavior of cursors opened for this statement handle.
|
SQL_ATTR_FOR_FETCH_ONLY | Integer | Indicates if cursors opened for this statement
handle should be read-only.
|
SQL_ATTR_IMP_PARAM_DESC | Integer | The descriptor handle used by the CLI implementation to provide parameter values for this statement handle. |
SQL_ATTR_IMP_ROW_DESC | Integer | The descriptor handle used by the CLI implementation to retrieve row data using this statement handle. |
SQL_ATTR_ROWSET_SIZE | Integer | A 32–bit integer value that specifies the number of rows in the rowset. This is the number of rows returned by each call to SQLExtendedFetch(). The default value is 1. |
SQLSTATE | Description | Explanation |
---|---|---|
HY001 | Memory allocation failure | The driver is unable to allocate memory required to support the processing or completion of the function. |
HY009 | Argument value that is not valid | The argument pvParam is a null pointer.
An fAttr that is not valid value is specified. |
HYC00 | Driver not capable | DB2® UDB CLI recognizes the option but does not support it. |