Difference between revisions of "OpenDBX/C API/odbx row fetch"
m (OpenDBX row fetch moved to OpenDBX/API/odbx row fetch) |
(Talk) (docbook2x update) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | + | '''Retrieve rows from the result set''' | |
+ | |||
+ | #include <odbx.h> | ||
int '''odbx_row_fetch'''( | int '''odbx_row_fetch'''( | ||
− | odbx_result_t* '''result''' ) | + | odbx_result_t* '''''result''''' ) |
== Description == | == Description == | ||
− | Retrieves the values of a row from the current result set returned by [[ | + | Retrieves the values of a row from the current result set returned by [[OpenDBX/API/odbx_result|odbx_result]](). Until this function is invoked, no row and field data is available via [[OpenDBX/API/odbx_field_length|odbx_field_length]]() or [[OpenDBX/API/odbx_field_value|odbx_field_value]]() 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 [[ | + | 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 [[OpenDBX/API/odbx_result|odbx_result]]() the next time or the outstanding rows will be returned within the next result. |
− | + | [[OpenDBX/API/odbx_row_fetch|odbx_row_fetch]]() requires a valid '''''result''''' object which was created by [[OpenDBX/API/odbx_result|odbx_result]](). It must not have been feed to [[OpenDBX/API/odbx_result_free|odbx_result_free]]() before. | |
− | == Return | + | == Return value == |
− | + | [[OpenDBX/API/odbx_row_fetch|odbx_row_fetch]]() will return one ("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 zero ("0") indicating that the result set doesn't contain more rows. | |
− | In case of an error, values less than zero are returned | + | In case of an error, values less than zero are returned encodeing the reason why the error occurred. |
== Errors == | == Errors == | ||
− | ; -ODBX_ERR_PARAM : The '''result''' parameter is either NULL or the object is invalid. This is usually the case if | + | ; -ODBX_ERR_PARAM : The '''''result''''' parameter is either NULL or the object is invalid. This is usually the case if result has been already feed to [[OpenDBX/API/odbx_result_free|odbx_result_free]](). |
== See also == | == See also == | ||
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_column_count|odbx_column_count]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_column_name|odbx_column_name]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_column_type|odbx_column_type]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_error|odbx_error]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_error_type|odbx_error_type]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_field_length|odbx_field_length]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_field_value|odbx_field_value]]() |
− | * [[OpenDBX | + | * [[OpenDBX/API/odbx_result|odbx_result]]() |
---- | ---- | ||
− | Back to [[OpenDBX API|Overview]] | + | Back to [[OpenDBX/API|Overview]] |
Revision as of 22:00, 19 May 2007
Retrieve rows from the result set
#include <odbx.h> int odbx_row_fetch( odbx_result_t* result )
Description
Retrieves the values of a row from the current result set returned by odbx_result(). Until this function is invoked, no row and field data is available via odbx_field_length() or odbx_field_value() 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 odbx_result() the next time or the outstanding rows will be returned within the next result.
odbx_row_fetch() requires a valid result object which was created by odbx_result(). It must not have been feed to odbx_result_free() before.
Return value
odbx_row_fetch() will return one ("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 zero ("0") indicating that the result set doesn't contain more rows.
In case of an error, values less than zero are returned encodeing the reason why the error occurred.
Errors
- -ODBX_ERR_PARAM
- The result parameter is either NULL or the object is invalid. This is usually the case if result has been already feed to odbx_result_free().
See also
- odbx_column_count()
- odbx_column_name()
- odbx_column_type()
- odbx_error()
- odbx_error_type()
- odbx_field_length()
- odbx_field_value()
- odbx_result()
Back to Overview