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_batch

Description

This method is used to execute the number of sql_stmts by num_sql_stmt. If num_sql_stmt queries are all executed successfully, the return value is 0 (no error); otherwise, the error code is returned. The results of each query are transferred by the query_result. The results of each query are retrieved by CCI_QUERY_RESULT_RESULT and CCI_QUERY_RESULT_ERR_MSG. The query results used must be deleted by cci_query_result_free.

Syntax

int cci_execute_batch(int conn_handle, int num_sql_stmt, char **sql_stmt, T_CCI_QUERY_RESULT **query_result, T_CCI_ERROR *err_buf)

  • conn_handle : (IN) Connection handle
  • num_sql_stmt : (IN) The number of sql_stmts
  • sql_stmt : (IN) SQL statement array
  • query_result : (OUT) The results of sql_stmt
  • err_buf : (OUT) Database error buffer
Return Value
  • Error code (0 : no error)
Example

T_CCI_QUERY_RESULT *qr;

char **sql_stmt;


 
res = cci_execute_batch(conn, num_sql, sql_stmt, &qr, &err_buf);

if (res < 0) {

  /* error */

}

else {

for (i=1 ; i <= num_sql ; i++) {

  result_count = CCI_QUERY_RESULT_RESULT(qr, i);

  if (resul_count < 0)

    err_msg = CCI_QUERY_RESULT_ERR_MSG(qr, i);

}

cci_query_result_free(qr, num_sql);

}