Hitachi

Hitachi Advanced Database Application Development Guide


19.4.9 a_rdb_SQLExecute() (execute a preprocessed SQL statement)

Organization of this subsection

(1) Function

This CLI function executes a preprocessed SQL statement. The function can execute the following SQL statements:

When a_rdb_SQLExecute()is executed on a SELECT statement, a cursor is opened.

(2) Format

signed short a_rdb_SQLExecute
(
  void                          *ConnectionHandle,   /* In */
  void                          *StatementHandle,    /* In */
  void                          *Option              /* In */
)

(3) Arguments

ConnectionHandle

Specifies a connection handle.

StatementHandle

Specifies a statement handle.

Option

Specifies NULL.

(4) Return value

  1. If a_rdb_SQLExecute() terminates normally, a_rdb_RC_SQL_SUCCESS or a_rdb_RC_SQL_NO_DATA is returned.

  2. If execution of the SQL statement is completed successfully, but the disk containing server message log files or 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_SQLExecute() cannot be executed in the following cases:

    • Connection has not been established.

    • An invalid statement handle is specified.

  2. A preprocessed SQL statement must be available for the specified statement handle.

  3. To open a cursor that was opened before, you must first close it, and then re-open it.

  4. To use a_rdb_SQLFetch() to a fetch row, you must first open the cursor, and then fetch the row.

  5. If COMMIT or ROLLBACK (including implicit rollback) is executed, all cursors that are open at that point are closed.