SQLGetStmtOption - Return current setting of a statement option
SQLGetStmtOption() has been deprecated and replaced with SQLGetStmtAttr(). Although this version of DB2® UDB CLI continues to support SQLGetStmtOption(), it is recommended that you begin using SQLGetStmtAttr() in your DB2 UDB CLI programs so that they conform to the latest standards.
SQLGetStmtOption() returns the current settings of the specified statement option.
These options are set using the SQLSetStmtOption() function.
Syntax
SQLRETURN SQLGetStmtOption( SQLHSTMT hstmt, SQLSMALLINT fOption, SQLPOINTER pvParam);
Function arguments
Table 1. SQLStmtOption arguments Data type Argument Use Description SQLHSTMT hstmt Input Connection handle. SQLSMALLINT fOption Input Option to retrieve. See Table 2 for more information. SQLPOINTER pvParam Output Value of the option. Depending on the value of fOption this can be a 32-bit integer value, or a pointer to a null terminated character string.
Usage
SQLGetStmtOption() provides the same function as SQLGetStmtAttr(), both functions are supported for compatibility reasons.
See Table 2 for a list of statement options.
Return codes
- SQL_SUCCESS
- SQL_SUCCESS_WITH_INFO
- SQL_ERROR
- SQL_INVALID_HANDLE
Diagnostics
Table 2. SQLStmtOption SQLSTATEs 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. A fOption that is not valid value is specified.
HYC00 Driver not capable DB2 UDB CLI recognizes the option but does not support it.
References
SQLGetStmtAttr - Get the value of a statement attribute
Parent topic:
DB2 UDB CLI functions