SQLNumParams() returns the number of parameter markers in an SQL statement.
SQLRETURN SQLNumParams (SQLHSTMT StatementHandle, SQLSMALLINT *ParameterCountPtr);
Data type | Argument | Use | Description |
---|---|---|---|
SQLHSTMT | StatementHandle | Input | Statement handle. |
SQLSMALLINT * | ParameterCountPtr | Output | Number of parameters in the statement. |
This function can only be called after the statement that is associated with StatementHandle has been prepared. If the statement does not contain any parameter markers, ParameterCountPtr is set to 0.
An application can call this function to determine how many SQLBindParameter() calls are necessary for the SQL statement associated with the statement handle.
SQLSTATE | Description | Explanation |
---|---|---|
40003 08S01 | Communication link failure | The communication link between the application and data source fails before the function is completed. |
HY001 | Memory allocation failure | DB2® UDB CLI is unable to allocate memory required to support the processing or completion of the function. |
HY008 | Operation canceled | |
HY009 | Argument value that is not valid | ParameterCountPtr is null. |
HY010 | Function sequence error | This function is called before SQLPrepare() is
called for the specified StatementHandle The function is called while in a data-at-processing (SQLParamData(), SQLPutData()) operation. |
HY013 | Unexpected memory handling error | DB2 UDB CLI is unable to access memory required to support the processing or completion of the function. |
HYT00 | Timeout expired |
None.
Refer to the SQLNativeSql() rzadpfnnsql.htm#rzadpfnnsql__xmnsql.