SQLGetStmtOption - Return current setting of a statement option

Purpose

Start of changeSQLGetStmtOption() 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.End of change

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.
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.
SQLSMALLINT fOption Input Option to retrieve. See Table 2 for more information.

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

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.