This function is used to prepare SQL execution by acquiring request handle for SQL statements. If a SQL statement consists of multiple queries, the preparation is performed only for the first query. With the parameter of this function, an address to T_CCI_ERROR where connection handle, SQL statement, flag, and error information are saved.
CCI_PREPARE_UPDATABLE or CCI_PREPARE_INCLUDE_OID can be configured in flag. If CCI_PREPARE_UPDATABLE is configured, updatable result set is created and CCI_PREPARE_INCLUDE_OID is automatically configured. However, not all updatable result sets are created even though CCI_PREPARE_UPDATABLE is configured. So you need to check if the results are updatable by using cci_is_updatable after preparation.
The conditions of updatable queries are as follows:
int cci_prepare(int conn_handle, char *sql_stmt, char flag,T_CCI_ERROR *err_buf)