Hitachi

Hitachi Advanced Database Application Development Guide


16.7.6 SQLNumParams

Organization of this subsection

(1) Function

This ODBC function returns the number of parameters in a prepared SQL statement.

(2) Format

SQLRETURN SQLNumParams
(
  SQLHSTMT        StatementHandle,     /* In */
  SQLSMALLINT   * ParameterCountPtr    /* Out */
)

(3) Arguments

StatementHandle

Specifies a statement handle.

Specify a value that was output by *OutputHandlePtr of SQLAllocHandle before this function is executed.

ParameterCountPtr

Specifies a pointer to the buffer in which the number of parameters in the SQL statement is to be returned.

The number of parameters contained in the SQL statement passed to SQLPrepare before this function is executed is set.

(4) Return value

This ODBC function returns SQL_SUCCESS, SQL_ERROR, or SQL_INVALID_HANDLE.

(5) SQLSTATE

This ODBC function returns one of the following SQLSTATE values:

SQLSTATE

Description

Remarks

Returned

01000

General warning

--

N

08S01

Communication link failure

N

HY000

General error

N

HY001

Memory allocation error

N

HY008

Operation cancelled

N

HY009

Invalid use of null pointer

NULL is specified in ParameterCountPtr.

Y

HY010

Function sequence error

--

Y

HY013

Memory management error

N

HY117

Connection suspended

N

HYT01

Connection timeout expired

N

IM001

Driver does not support this function

N

IM018

Incomplete asynchronous execution

N

Legend:

Y: This SQLSTATE might be returned by the HADB ODBC driver.

N: This SQLSTATE is not returned by the HADB ODBC driver.

--: None