The cci_oid_put2 function sets the attr_name attribute values of the given oid to new_val. The last value of attr_name must be NULL. To insert a NULL value, set the value of new_val[i] to NULL.
The type of new_val[i] for a_type is shown in the table below.
Type of new_val[i] for a_type
Type |
value type |
---|---|
CCI_A_TYPE_STR |
char* |
CCI_A_TYPE_INT |
int* |
CCI_A_TYPE_FLOAT |
float* |
CCI_A_TYPE_DOUBLE |
double* |
CCI_A_TYPE_BIT |
T_CCI_BIT* |
CCI_A_TYPE_SET |
T_CCI_SET |
CCI_A_TYPE_DATE |
T_CCI_DATE* |
CCI_A_TYPE_BIGINT |
int64_t (For Windows : __int64) |
intcci_oid_put2(int conn_handle, char *oidstr, char **attr_name, void **new_val, int *a_type, T_CCI_ERROR *err_buf)
char *attr_name[array_size]
void *attr_val[array_size]
int a_type[array_size]
int int_val
…
attr_name[0] = "attr_name0"
attr_val[0] = &int_val
a_type[0] = CCI_A_TYPE_INT
attr_name[1] = "attr_name1"
attr_val[1] = "attr_val1"
a_type[1] = CCI_A_TYPE_STR
…
attr_name[num_attr] = NULL
res = cci_put2(con_h, oid_str, attr_name, attr_val, a_type, &error)
…