Hitachi

Hitachi Advanced Database Application Development Guide


16.9.2 SQLNumResultCols

Organization of this subsection

(1) Function

This ODBC function returns the number of columns in a result set of a prepared SQL statement.

(2) Format

SQLRETURN SQLNumResultCols
(
  SQLHSTMT        StatementHandle,     /* In */
  SQLSMALLINT   * ColumnCountPtr       /* Out */
)

(3) Arguments

StatementHandle

Specifies a statement handle.

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

ColumnCountPtr

Specifies a pointer to the buffer in which the number of columns in a result set is to be returned.

(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 ColumnCountPtr.

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

IM017

Invalid asynchronous polling

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