Hitachi

Hitachi Advanced Database Application Development Guide


19.4.5 a_rdb_SQLCloseCursor() (close the cursor)

Organization of this subsection

(1) Function

This CLI function closes the cursor and terminates row fetching.

If there is a processing real thread that is fetching rows, this function terminates that processing real thread.

(2) Format

signed short a_rdb_SQLCloseCursor
(
  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_SQLCloseCursor() terminates normally, a_rdb_RC_SQL_SUCCESS is returned.

  2. If the cursor is closed 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_SQLCloseCursor() cannot be executed in the following cases:

    • Connection has not been established.

    • An invalid statement handle is specified.

    • A row fetching error is detected during the cursor close processing.

  2. If the transaction is terminated, all cursors that are open at that point are closed. If database update processing is implicitly invalidated, the cursors are also all closed, in which case the KFAA51001-E or KFAA51002-E message is output to the server message log file and client message log file.