Hitachi

Hitachi Advanced Database Application Development Guide


19.4.13 a_rdb_SQLNumResultCols() (acquire the number of retrieval result columns)

Organization of this subsection

(1) Function

This CLI function acquires the number of retrieval result columns.

(2) Format

signed short a_rdb_SQLNumResultCols
(
  void                          *ConnectionHandle,   /* In  */
  void                          *StatementHandle,    /* In  */
  unsigned short                *ColumnCount,        /* Out */
  void                          *Option              /* In  */
)

(3) Arguments

ConnectionHandle

Specifies a connection handle.

StatementHandle

Specifies a statement handle.

ColumnCount

Specifies the address at which the number of retrieval result columns is to be stored.

Option

Specifies NULL.

(4) Return value

  1. If a_rdb_SQLNumResultCols() terminates normally, a_rdb_RC_SQL_SUCCESS is returned.

  2. If the number of retrieval result columns is acquired successfully, but the disk containing client message log files has become full, a_rdb_RC_SQL_WARNING is returned.

  3. If an error occurs while messages cannot be output to the client message log file, the error cause code is returned. For details about the error cause code, see 19.8 Return values of the CLI functions.

(5) Notes

  1. a_rdb_SQLNumResultCols() cannot be executed in the following cases:

    • Connection has not been established.

    • An invalid statement handle is specified.

  2. If the SQL statement allocated to the statement handle is not a SELECT statement, 0 is stored in the area for storing the number of retrieval result columns.