Specification: | DB2 CLI 2.1 | ODBC 1.0 |
|
SQLNumParams() returns the number of parameter markers in an SQL statement.
Syntax
SQLRETURN SQLNumParams (SQLHSTMT StatementHandle, SQLSMALLINT FAR *ParameterCountPtr);
Function arguments
Table 94. SQLNumParams arguments
Data type | Argument | Use | Description |
---|---|---|---|
SQLHSTMT | StatementHandle | Input | Statement handle. |
SQLSMALLINT | ParameterCountPtr | Output | Number of parameters in the statement. |
Usage
This function can only be called after the statement 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.
Return codes
Diagnostics
Table 95. SQLNumParams SQLSTATEs
SQLSTATE | Description | Explanation |
---|---|---|
HY001 | Memory allocation failure. | DB2 CLI is unable to allocate memory required to support execution or completion of the function. |
HY010 | Function sequence error. | This function was called before SQLPrepare() was called for the specified StatementHandle. |
HY013 | Unexpected memory handling error. | DB2 CLI was unable to access memory required to support execution or completion of the function. |
Restrictions
None.
Related reference