Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

cci_execute

Description

This function is used to execute the prepared SQL statement, which is executing cci_prepare(). A request handle, a flag, the maximum length of the column to be fetched and the address of the T_CCI_ERROR construct to contain the error information are specified as parameters for this function.

The function of retrieving the query result from the server through a flag can be classified as synchronous or asynchronous. If the flag is set to CCI_EXEC_QUERY_ALL, a synchronous mode (sync_mode) is used to retrieve query results immediately after executing prepared queries if it is set to CCI_EXEC_ASYNC, an asynchronous mode (async_mode) is used to retrieve the result immediately each time a query result is created. The flag is set to CCI_EXEC_QUERY_ALL by default, and in such cases the following rules are applied.

  • The return value is the result of the first query.
  • If an error occurs in any query, the execution is processed as a failure.
  • For a query composed of in a query composed of q1 q2 q3 if an error occurs in q2 after q1 succeeds the execution, the result of q1 remains valid. That is, the previous successful query executions are not rolled back when an error occurs.
  • If a query is executed successfully, the result of the second query can be obtained using cci_next_result().

max_col_size is a value that is used to determine the size of the column to be transferred to the client when the type of the column of the prepared query is CHAR, VARCHAR, NCHAR, VARNCHAR, BIT or VARBIT. If it is set to 0, all data is transferred.

Syntax

int cci_execute(int req_handle, char flag, int max_col_size, T_CCI_ERROR *err_buf)

  • req_handle : (IN) Request handle of a prepared SQL statement
  • flag : (IN) Exec flag (CCI_EXEC_ASYNC or CCI_EXEC_QUERY_ALL)
  • max_col_size : (IN) The size of the column to be fetched
  • err_buf : (OUT) Database error buffer
Return Value
  • Success
    • SELECT : Returns the number of results in sync mode returns 0 in async mode.
    • INSERT, UPDATE : Returns the number of tuples reflected.
    • Others queries : 0
  • Failure : Error code
Error Code
  • CCI_ER_REQ_HANDLE
  • CCI_ER_BIND
  • CCI_ER_DBMS
  • CCI_ER_COMMUNICATION