odbx_field_value - Man Page

Returns the data stored in a field


#include <opendbx/api.h>

const char* odbx_field_value (odbx_result_t* result, unsigned long pos);


odbx_field_value() returns a pointer to the field data specified by the column index pos. The field is part of the current row which was retrieved by the latest call to odbx_row_fetch().

All values except binary objects are handed back as strings terminated by the zero character. This does also apply to numeric values, dates, etc. They have to be converted to their binary machine dependent representation before arithmetic operations can be done. If a value is undefined, i.e. "NULL" is attached to the field in the database, an equivalent NULL pointer is returned.

The result parameter required by this function must be a valid result set returned by odbx_result() and must not has been feed to odbx_result_finish() before.

Valid column indices for the requested column provided via pos start with zero and end with the value returned by odbx_column_count() minus one.

Return Value

The function provides the address pointing to the beginning of the field value where the string or binary object is stored in memory to the caller. It returns a NULL pointer if the field is a "NULL" value.


This function will also return zero if the result parameter is invalid or if the value of pos is out of range.

See Also

odbx_column_type(), odbx_field_length(), odbx_result()

Referenced By

odbx_column_type(3), odbx_field_length(3), odbx_lo_open(3), odbx_row_fetch(3).

2 February 2021 OpenDBX