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_array

Description

This method is used to execute a query using the data bound to a prepared SQL statement. Uses multiple binding data to get the same results as when executing a single query multiple times. The results of each query are sent by query_result. The results of each query are retrieved by CCI_QUERY_RESULT_STMT_TYPE, 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_array(int req_handle, T_CCI_QUERY_RESULT **query_result, T_CCI_ERROR *err_buf)

  • req_handle : (IN) Request handle of a prepared SQL statement
  • query_result : (OUT) Query results
  • err_buf : (OUT) Database error buffer
Return Value
  • The number of queries executed ( < 0 : error code)
Example

T_CCI_QUERY_RESULT  *qr;

char  **sql_stmt;


 
cci_prepare( ... );

cci_bind_param( ... );

 
...
 
res = cci_execute_array(conn, &qr, &err_buf);

if (res < 0) {

  /* error */

}

else {

for (i=1 ; i <= res ; 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, res);

}