The cci_get_data function gets the col_noth value from the currently fetched result. The type of the value variable is determined according to the given type parameter, and the value or the pointer is copied to the value variable accordingly.
For a value to be copied, the memory for the address to be transferred to the value variable must have been previously assigned. Note that if a pointer is copied, a pointer in the application client library is returned, so the value becomes invalid next time the cci_get_data() function is called.
In addition, the pointer returned by the pointer copy must not be freed. However, if the type is CCI_A_TYPE_SET, the memory must be freed by using the cci_set_free() function after using the set because the set is returned after the T_CCI_SET type memory is allocated. The following table shows the summary of type parameters and data types of their corresponding values.
type |
value Type |
Meaning |
---|---|---|
CCI_A_TYPE_STR |
char** |
pointer copy |
CCI_A_TYPE_INT |
int* |
value copy |
CCI_A_TYPE_FLOAT |
float* |
value copy |
CCI_A_TYPE_DOUBLE |
double* |
value copy |
CCI_A_TYPE_BIT |
T_CCI_BIT* |
value copy (pointer copy for each member) |
CCI_A_TYPE_SET |
T_CCI_SET* |
memory alloc and value copy |
CCI_A_TYPE_DATE |
T_CCI_DATE* |
value copy |
CCI_A_TYPE_BIGINT |
int64_t* |
value copy |
CCI_A_TYPE_BLOB |
T_CCI_BLOB |
memory alloc and value copy |
CCI_A_TYPE_CLOB |
T_CCI_CLOB |
memory alloc and value copy |
int cci_get_data(int req_handle, int col_no, int type, void *value, int *indicator)