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.
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.
int cci_execute(int req_handle, char flag, int max_col_size, T_CCI_ERROR *err_buf)