odbx_row_fetch(3)

NAME
odbx_row_fetch - Retrieve rows from the result set

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

\FCint odbx_row_fetch\F[]
\FC(odbx_result_t* result);\F[]

DESCRIPTION
Retrieves the values of a row from the current result set returned by \FCodbx_result\F[](). Until this function is invoked, no row and field data is available via \FCodbx_field_length\F[]() or \FCodbx_field_value\F[]() and these functions will return zero respectively NULL.

Moreover, it is necessary to fetch all rows from a result set until zero is returned indicating that no more rows are available. Otherwise - depending on the backend - an error may occur after calling \FCodbx_result\F[]() the next time or the outstanding rows will be returned within the next result.

\FCodbx_row_fetch\F[]() requires a valid \FCresult\F[] object which was created by \FCodbx_result\F[](). It must not have been feed to \FCodbx_result_finish\F[]() before.

RETURN VALUE
\FCodbx_row_fetch\F[]() will return \FCODBX_ROW_NEXT\F[] ("1") as long as rows are available from the result set. After the last row has been made available, further calls to this function will return \FCODBX_ROW_DONE\F[] ("0") indicating that the result set doesn't contain more rows. The named constants are available since OpenDBX 1.3.2 and the numbers in brackets have to be used instead if a previous release is is the basis for the application development.

In case of an error, values less than zero are returned encodeing the reason why the error occurred.

ERRORS

-\FCODBX_ERR_PARAM\F[]
    The \FCresult\F[] parameter is either NULL or the object is invalid. This is usually the case if result has been already feed to \FCodbx_result_finish\F[]().

SEE ALSO
\FCodbx_column_count\F[](), \FCodbx_column_name\F[](), \FCodbx_column_type\F[](), \FCodbx_error\F[](), \FCodbx_error_type\F[](), \FCodbx_field_length\F[](), \FCodbx_field_value\F[](), \FCodbx_result\F[]()