odbx_field_value(3)

NAME
odbx_field_value - Returns the data stored in a field

SYNOPSIS
\FC#include <opendbx/api.h>\F[]

\FCconst char* odbx_field_value\F[]
\FC(odbx_result_t* result, unsigned long pos);\F[]

DESCRIPTION
\FCodbx_field_value\F[]() returns a pointer to the field data specified by the column index \FCpos\F[]. The field is part of the current row which was retrieved by the latest call to \FCodbx_row_fetch\F[]().

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 \FCresult\F[] parameter required by this function must be a valid result set returned by \FCodbx_result\F[]() and must not has been feed to \FCodbx_result_finish\F[]() before.

Valid column indices for the requested column provided via \FCpos\F[] start with zero and end with the value returned by \FCodbx_column_count\F[]() 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.

ERRORS
This function will also return zero if the \FCresult\F[] parameter is invalid or if the value of \FCpos\F[] is out of range.

SEE ALSO
\FCodbx_column_type\F[](), \FCodbx_field_length\F[](), \FCodbx_result\F[]()