C API  19.3.0
Oracle NoSQL Database C Client

Functions

kv_error_t kv_record_put_int (kv_record_t *record, const char *name, kv_int_t value)
 Sets an int value for the named field. More...
 
kv_error_t kv_record_put_long (kv_record_t *record, const char *name, kv_long_t value)
 Sets a long value for the named field. More...
 
kv_error_t kv_record_put_float (kv_record_t *record, const char *name, kv_float_t value)
 Sets a float value for the named field. More...
 
kv_error_t kv_record_put_double (kv_record_t *record, const char *name, kv_double_t value)
 Sets a double value for the named field. More...
 
kv_error_t kv_record_put_boolean (kv_record_t *record, const char *name, kv_boolean_t value)
 Sets a boolean value for the named field. More...
 
kv_error_t kv_record_put_string (kv_record_t *record, const char *name, const char *value)
 Sets a string value for the named field. More...
 
kv_error_t kv_record_put_bytes (kv_record_t *record, const char *name, const unsigned char *bytes, kv_int_t size)
 Sets a byte array value for the named field. More...
 
kv_error_t kv_record_put_bytes_copy (kv_record_t *record, const char *name, const unsigned char *bytes, kv_int_t size)
 Sets a byte array value for the named field. More...
 
kv_error_t kv_record_put_null (kv_record_t *record, const char *name)
 Sets a NULL value for the named field. More...
 
kv_array_tkv_record_put_array (kv_record_t *record, const char *name)
 Creates a nested array for the named field. More...
 
kv_array_tkv_record_put_sized_array (kv_record_t *record, const char *name, kv_int_t size)
 Creates a nested array with an initial size for the named field. More...
 
kv_map_tkv_record_put_map (kv_record_t *record, const char *name)
 Creates a nested map for the named field. More...
 
kv_record_tkv_record_put_record (kv_record_t *record, const char *name)
 Creates a nested record structure for the given record value. More...
 
kv_error_t kv_record_get_int (const kv_record_t *record, const char *name, kv_int_t *value)
 Returns a int for a named field in a record. More...
 
kv_error_t kv_record_get_long (const kv_record_t *record, const char *name, kv_long_t *value)
 Returns a long for a named field in a record. More...
 
kv_error_t kv_record_get_float (const kv_record_t *record, const char *name, kv_float_t *value)
 Returns a float for a named field in a record. More...
 
kv_error_t kv_record_get_double (const kv_record_t *record, const char *name, kv_double_t *value)
 Returns a double for a named field in a record. More...
 
kv_error_t kv_record_get_boolean (const kv_record_t *record, const char *name, kv_boolean_t *value)
 Returns a boolean for a named field in a record. More...
 
kv_error_t kv_record_get_string (const kv_record_t *record, const char *name, const char **value)
 Returns a string for a named field in a record. More...
 
kv_error_t kv_record_get_bytes (const kv_record_t *record, const char *name, const unsigned char **bytes, kv_int_t *size)
 Returns a byte array value for a named field in a record. More...
 
kv_error_t kv_record_get_array (const kv_record_t *record, const char *name, kv_array_t **value)
 Returns a nested array for a named field in a record. More...
 
kv_error_t kv_record_get_map (const kv_record_t *record, const char *name, kv_map_t **value)
 Returns a nested map for a named field in a record. More...
 
kv_error_t kv_record_get_record (const kv_record_t *record, const char *name, kv_record_t **value)
 Returns a nested record for a named field in a record. More...
 
kv_field_tkv_record_get_field (const kv_record_t *record, const char *name)
 Returns a field handle from a record by name. More...
 
kv_field_t ** kv_record_get_fields (kv_record_t *record, kv_int_t *num)
 Returns all field values in a record. More...
 

Detailed Description

Function Documentation

kv_error_t kv_record_get_array ( const kv_record_t record,
const char *  name,
kv_array_t **  value 
)

Returns a nested array for a named field in a record.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[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_record_get_boolean ( const kv_record_t record,
const char *  name,
kv_boolean_t value 
)

Returns a boolean for a named field in a record.

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]recordThe record handle.
[in]nameThe field name.
[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_record_get_bytes ( const kv_record_t record,
const char *  name,
const unsigned char **  bytes,
kv_int_t size 
)

Returns a byte array value for a named field in a record.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[out]bytesThe output byte array value.
[out]sizeThe size of the output byte array.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_get_double ( const kv_record_t record,
const char *  name,
kv_double_t value 
)

Returns a double for a named field in a record.

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]recordThe record handle.
[in]nameThe field name.
[out]valueA pointer to the output value.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_field_t* kv_record_get_field ( const kv_record_t record,
const char *  name 
)

Returns a field handle from a record by name.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
Returns
A field handle or NULL if it does not exist.
kv_field_t** kv_record_get_fields ( kv_record_t record,
kv_int_t num 
)

Returns all field values in a record.

Note
The returned data is owned by the record handle. Its data is valid until the record is modified or released, and it will released implicitly when the record is released.
Parameters
[in]recordThe record handle.
[out]numThe number of fields returned.
Returns
An array of fields.
kv_error_t kv_record_get_float ( const kv_record_t record,
const char *  name,
kv_float_t value 
)

Returns a float for a named field in a record.

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]recordThe record handle.
[in]nameThe field name.
[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_record_get_int ( const kv_record_t record,
const char *  name,
kv_int_t value 
)

Returns a int for a named field in a record.

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]recordThe record handle.
[in]nameThe field name.
[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_record_get_long ( const kv_record_t record,
const char *  name,
kv_long_t value 
)

Returns a long for a named field in a record.

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]recordThe record handle.
[in]nameThe field name.
[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_record_get_map ( const kv_record_t record,
const char *  name,
kv_map_t **  value 
)

Returns a nested map for a named field in a record.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[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_record_get_record ( const kv_record_t record,
const char *  name,
kv_record_t **  value 
)

Returns a nested record for a named field in a record.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[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_record_get_string ( const kv_record_t record,
const char *  name,
const char **  value 
)

Returns a string for a named field in a record.

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]recordThe record handle.
[in]nameThe field name.
[out]valueA pointer to the output UTF-8 encoded string.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_array_t* kv_record_put_array ( kv_record_t record,
const char *  name 
)

Creates a nested array for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
Returns
An empty array value handle on success, otherwise NULL.
kv_error_t kv_record_put_boolean ( kv_record_t record,
const char *  name,
kv_boolean_t  value 
)

Sets a boolean value for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]valueThe value to be set.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_put_bytes ( kv_record_t record,
const char *  name,
const unsigned char *  bytes,
kv_int_t  size 
)

Sets a byte array value for the named field.

This function differs from kv_record_put_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 record structure in this function is released.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]bytesThe byte array value to be set.
[in]sizeThe size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_put_bytes_copy ( kv_record_t record,
const char *  name,
const unsigned char *  bytes,
kv_int_t  size 
)

Sets a byte array value for the named field.

This function differs from kv_record_put_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]recordThe record handle. named field.
[in]nameThe field name.
[in]bytesThe byte array value to be set.
[in]sizeThe size of bytes.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_put_double ( kv_record_t record,
const char *  name,
kv_double_t  value 
)

Sets a double value for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]valueThe value to be set.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_put_float ( kv_record_t record,
const char *  name,
kv_float_t  value 
)

Sets a float value for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]valueThe value to be set.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_put_int ( kv_record_t record,
const char *  name,
kv_int_t  value 
)

Sets an int value for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]valueThe value to be set.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_record_put_long ( kv_record_t record,
const char *  name,
kv_long_t  value 
)

Sets a long value for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]valueThe value to be set.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_map_t* kv_record_put_map ( kv_record_t record,
const char *  name 
)

Creates a nested map for the named field.

Parameters
[in]recordThe record handle. map value.
[in]nameThe field name.
Returns
An empty map value handle on success, otherwise NULL.
kv_error_t kv_record_put_null ( kv_record_t record,
const char *  name 
)

Sets a NULL value for the named field.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_record_t* kv_record_put_record ( kv_record_t record,
const char *  name 
)

Creates a nested record structure for the given record value.

Parameters
[in]recordThe record handle.
[in]nameThe field name.
Returns
An empty record value handle on success, otherwise NULL.
kv_array_t* kv_record_put_sized_array ( kv_record_t record,
const char *  name,
kv_int_t  size 
)

Creates a nested array with an initial size for the named field.

Parameters
[in]recordThe record handle. array value.
[in]nameThe field name.
[in]sizeThe initial size of the array.
Returns
An empty array value handle, initialized based on the specified size, on success, otherwise NULL.
kv_error_t kv_record_put_string ( kv_record_t record,
const char *  name,
const char *  value 
)

Sets a string value for the named field.

Note
The string must be a valid UTF-8 encoded string.
Parameters
[in]recordThe record handle.
[in]nameThe field name.
[in]valueThe value to be set.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.