C API  19.3.0
Oracle NoSQL Database C Client

Functions

kv_error_t kv_array_append_int (kv_array_t *array, kv_int_t value)
 Appends an int value to an array. More...
 
kv_error_t kv_array_append_long (kv_array_t *array, kv_long_t value)
 Appends a long value to an array. More...
 
kv_error_t kv_array_append_float (kv_array_t *array, kv_float_t value)
 Appends a float value to an array. More...
 
kv_error_t kv_array_append_double (kv_array_t *array, kv_double_t value)
 Appends a double value to an array. More...
 
kv_error_t kv_array_append_boolean (kv_array_t *array, kv_boolean_t value)
 Appends a boolean value to an array. More...
 
kv_error_t kv_array_append_string (kv_array_t *array, const char *value)
 Appends a string value to an array. More...
 
kv_error_t kv_array_append_bytes (kv_array_t *array, const unsigned char *bytes, kv_int_t size)
 Appends a byte array value to an array. More...
 
kv_error_t kv_array_append_bytes_copy (kv_array_t *array, const unsigned char *bytes, kv_int_t size)
 Appends a byte array value to an array. More...
 
kv_array_tkv_array_append_array (kv_array_t *array)
 Creates a nested array structure and appends it an array. More...
 
kv_map_tkv_array_append_map (kv_array_t *array)
 Creates a nested map structure and appends it an array. More...
 
kv_record_tkv_array_append_record (kv_array_t *array)
 Creates a nested record structure and appends it an array. More...
 
kv_error_t kv_array_add_int (kv_array_t *array, kv_int_t index, kv_int_t value)
 Inserts an int value at the specified position in an array. More...
 
kv_error_t kv_array_add_long (kv_array_t *array, kv_int_t index, kv_long_t value)
 Inserts a long value at the specified position in an array. More...
 
kv_error_t kv_array_add_float (kv_array_t *array, kv_int_t index, kv_float_t value)
 Inserts a float value at the specified position in an array. More...
 
kv_error_t kv_array_add_double (kv_array_t *array, kv_int_t index, kv_double_t value)
 Inserts a double value at the specified position in an array. More...
 
kv_error_t kv_array_add_boolean (kv_array_t *array, kv_int_t index, kv_boolean_t value)
 Inserts a boolean value at the specified position in an array. More...
 
kv_error_t kv_array_add_string (kv_array_t *array, kv_int_t index, const char *value)
 Inserts a string value at the specified position in an array. More...
 
kv_error_t kv_array_add_bytes (kv_array_t *array, kv_int_t index, const unsigned char *bytes, kv_int_t size)
 Inserts a byte array at the specified position in an array. More...
 
kv_error_t kv_array_add_bytes_copy (kv_array_t *array, kv_int_t index, const unsigned char *bytes, kv_int_t size)
 Inserts a byte array at the specified position in an array. More...
 
kv_array_tkv_array_add_array (kv_array_t *array, kv_int_t index)
 Creates a nested array and inserts it at the specified position in an array. More...
 
kv_array_tkv_array_add_sized_array (kv_array_t *array, kv_int_t index, kv_int_t size)
 Creates a nested array with initial size and inserts it at the specified position in an array. More...
 
kv_map_tkv_array_add_map (kv_array_t *array, kv_int_t index)
 Creates a nested map and inserts it at the specified position in an array. More...
 
kv_record_tkv_array_add_record (kv_array_t *array, kv_int_t index)
 Creates a nested record and inserts it at the specified position in an array. More...
 
kv_int_t kv_array_get_size (const kv_array_t *array)
 Returns the number of element in an array value. More...
 
kv_error_t kv_array_get_int (const kv_array_t *array, kv_int_t index, kv_int_t *value)
 Returns an int value from an array. More...
 
kv_error_t kv_array_get_long (const kv_array_t *array, kv_int_t index, kv_long_t *value)
 Returns a long value from an array. More...
 
kv_error_t kv_array_get_float (const kv_array_t *array, kv_int_t index, kv_float_t *value)
 Returns a float value from an array. More...
 
kv_error_t kv_array_get_double (const kv_array_t *array, kv_int_t index, kv_double_t *value)
 Returns a double value from an array. More...
 
kv_error_t kv_array_get_boolean (const kv_array_t *array, kv_int_t index, kv_boolean_t *value)
 Returns a boolean value from an array. More...
 
kv_error_t kv_array_get_bytes (const kv_array_t *array, kv_int_t index, const unsigned char **bytes, kv_int_t *size)
 Returns a byte array value from an array. More...
 
kv_error_t kv_array_get_string (const kv_array_t *array, kv_int_t index, const char **value)
 Returns a string value from an array. More...
 
kv_error_t kv_array_get_array (const kv_array_t *array, kv_int_t index, kv_array_t **value)
 Returns a nested array value from an array. More...
 
kv_error_t kv_array_get_map (const kv_array_t *array, kv_int_t index, kv_map_t **value)
 Returns a nested map value from an array. More...
 
kv_error_t kv_array_get_record (const kv_array_t *array, kv_int_t index, kv_record_t **value)
 Returns a nested record value from an array. More...
 
kv_error_t kv_array_get_field (const kv_array_t *array, kv_int_t index, kv_field_t **fieldp)
 Returns a field value from an array. More...
 

Detailed Description

Function Documentation

kv_array_t* kv_array_add_array ( kv_array_t array,
kv_int_t  index 
)

Creates a nested array and inserts it at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
Returns
An empty array value handle on success, otherwise NULL.
kv_error_t kv_array_add_boolean ( kv_array_t array,
kv_int_t  index,
kv_boolean_t  value 
)

Inserts a boolean value at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_add_bytes ( kv_array_t array,
kv_int_t  index,
const unsigned char *  bytes,
kv_int_t  size 
)

Inserts a byte array at the specified position in an array.

This function differs from kv_array_add_bytes_copy() in that it does not copy the contents of the bytes passed to the function. Therefore, the bytes should not be released or modified until the array structure in this function is released.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]bytesThe byte array to be appended.
[in]sizeThe size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_add_bytes_copy ( kv_array_t array,
kv_int_t  index,
const unsigned char *  bytes,
kv_int_t  size 
)

Inserts a byte array at the specified position in an array.

This function differs from kv_array_add_bytes() in that it copies the contents of the bytes passed to the function, so that the buffer can be released, or modified and then reused in whatever way is required by the application.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]bytesThe byte array to be appended.
[in]sizeThe size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_add_double ( kv_array_t array,
kv_int_t  index,
kv_double_t  value 
)

Inserts a double value at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_add_float ( kv_array_t array,
kv_int_t  index,
kv_float_t  value 
)

Inserts a float value at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_add_int ( kv_array_t array,
kv_int_t  index,
kv_int_t  value 
)

Inserts an int value at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_add_long ( kv_array_t array,
kv_int_t  index,
kv_long_t  value 
)

Inserts a long value at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_map_t* kv_array_add_map ( kv_array_t array,
kv_int_t  index 
)

Creates a nested map and inserts it at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
Returns
An empty map value handle on success, NULL otherwise.
kv_record_t* kv_array_add_record ( kv_array_t array,
kv_int_t  index 
)

Creates a nested record and inserts it at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
Returns
An empty record value handle on success, NULL otherwise.
kv_array_t* kv_array_add_sized_array ( kv_array_t array,
kv_int_t  index,
kv_int_t  size 
)

Creates a nested array with initial size and inserts it at the specified position in an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]sizeThe initial size of the nested array.
Returns
An empty array value handle on success, sized based on the specified size, otherwise NULL.
kv_error_t kv_array_add_string ( kv_array_t array,
kv_int_t  index,
const char *  value 
)

Inserts a string value at the specified position in an array.

Note
The string must be a valid UTF-8 encoded string.
Parameters
[in]arrayThe array handle.
[in]indexThe index value.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_array_t* kv_array_append_array ( kv_array_t array)

Creates a nested array structure and appends it an array.

Parameters
[in]arrayThe array handle.
Returns
An empty array value handle on success, otherwise NULL.
kv_error_t kv_array_append_boolean ( kv_array_t array,
kv_boolean_t  value 
)

Appends a boolean value to an array.

Parameters
[in]arrayThe array handle.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_append_bytes ( kv_array_t array,
const unsigned char *  bytes,
kv_int_t  size 
)

Appends a byte array value to an array.

This function differs from kv_array_append_bytes_copy() in that it does not copy the contents of the bytes passed to the function. Therefore, the bytes should not be released or modified until the array structure in this function is released.

Parameters
[in]arrayThe array handle.
[in]bytesThe byte array to be appended.
[in]sizeThe size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_append_bytes_copy ( kv_array_t array,
const unsigned char *  bytes,
kv_int_t  size 
)

Appends a byte array value to an array.

This function differs from kv_array_append_bytes() in that it copies the contents of the bytes passed to the function, so that the buffer can be released, or modified and then reused in whatever way is required by the application.

Parameters
[in]arrayThe array handle.
[in]bytesThe byte array to be appended.
[in]sizeThe size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_append_double ( kv_array_t array,
kv_double_t  value 
)

Appends a double value to an array.

Parameters
[in]arrayThe array handle.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_append_float ( kv_array_t array,
kv_float_t  value 
)

Appends a float value to an array.

Parameters
[in]arrayThe array handle.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_append_int ( kv_array_t array,
kv_int_t  value 
)

Appends an int value to an array.

Parameters
[in]arrayThe array handle.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_append_long ( kv_array_t array,
kv_long_t  value 
)

Appends a long value to an array.

Parameters
[in]arrayThe array handle.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_map_t* kv_array_append_map ( kv_array_t array)

Creates a nested map structure and appends it an array.

Parameters
[in]arrayThe array handle.
Returns
An empty map value handle on success, otherwise NULL.
kv_record_t* kv_array_append_record ( kv_array_t array)

Creates a nested record structure and appends it an array.

Parameters
[in]arrayThe array handle.
Returns
An empty record value handle on success, otherwise NULL.
kv_error_t kv_array_append_string ( kv_array_t array,
const char *  value 
)

Appends a string value to an array.

Note
The string must be a valid UTF-8 encoded string.
Parameters
[in]arrayThe array handle.
[in]valueThe value to be appended.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_array ( const kv_array_t array,
kv_int_t  index,
kv_array_t **  value 
)

Returns a nested array value from an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_boolean ( const kv_array_t array,
kv_int_t  index,
kv_boolean_t value 
)

Returns a boolean value from an array.

Note
Performs an implicit cast and returns an error code if the field cannot be cast to the desired type without loss of information.
Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_bytes ( const kv_array_t array,
kv_int_t  index,
const unsigned char **  bytes,
kv_int_t size 
)

Returns a byte array value from an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]bytesThe output byte array.
[out]sizeThe output size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_double ( const kv_array_t array,
kv_int_t  index,
kv_double_t value 
)

Returns a double value from an array.

Note
Performs an implicit cast and returns an error code if the field cannot be cast to the desired type without loss of information.
Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_field ( const kv_array_t array,
kv_int_t  index,
kv_field_t **  fieldp 
)

Returns a field value from an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]fieldpA pointer to the output field.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_float ( const kv_array_t array,
kv_int_t  index,
kv_float_t value 
)

Returns a float value from an array.

Note
Performs an implicit cast and returns an error code if the field cannot be cast to the desired type without loss of information.
Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_int ( const kv_array_t array,
kv_int_t  index,
kv_int_t value 
)

Returns an int value from an array.

Note
Performs an implicit cast and returns an error code if the field cannot be cast to the desired type without loss of information.
Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_long ( const kv_array_t array,
kv_int_t  index,
kv_long_t value 
)

Returns a long value from an array.

Note
Performs an implicit cast and returns an error code if the field cannot be cast to the desired type without loss of information.
Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_map ( const kv_array_t array,
kv_int_t  index,
kv_map_t **  value 
)

Returns a nested map value from an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_array_get_record ( const kv_array_t array,
kv_int_t  index,
kv_record_t **  value 
)

Returns a nested record value from an array.

Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_int_t kv_array_get_size ( const kv_array_t array)

Returns the number of element in an array value.

Parameters
[in]arrayThe array handle.
Returns
the size of the array.
kv_error_t kv_array_get_string ( const kv_array_t array,
kv_int_t  index,
const char **  value 
)

Returns a string value from an array.

Note
Performs an implicit cast and returns an error code if the field cannot be cast to the desired type without loss of information.
Parameters
[in]arrayThe array handle.
[in]indexThe index in the array list.
[out]valueA pointer to the output UTF-8 encoded string.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.