Difference between revisions of "OpenDBX/C API/odbx row fetch"

From Linuxnetworks
< OpenDBX‎ | C API
Jump to: navigation, search
(header)
(enhanced article)
Line 6: Line 6:
 
     odbx_result_t* '''result''' )
 
     odbx_result_t* '''result''' )
  
= Description: =
+
= Description =
  
Retrieves a row of the result set returned by [[OpenDBX_result|odbx_result()]]. Until this function is invoked, no row and no field data is available via [[OpenDBX_field_length|odbx_field_length()]] and [[OpenDBX_field_value|odbx_field_value()]] and you must fetch all rows from a result set until zero is returned. Otherwise - depending on the backend - an error may occur after calling [[OpenDBX_result|odbx_result()]] the next time or the outstanding rows will be returned within the next result.
+
Retrieves the values of a row from the current result set returned by [[OpenDBX_result|odbx_result()]]. Until this function is invoked, no row and field data is available via [[OpenDBX_field_length|odbx_field_length()]] or [[OpenDBX_field_value|odbx_field_value()]] and these functions will return zero or NULL.
  
= Parameters: =
+
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_result|odbx_result()]] the next time or the outstanding rows will be returned within the next result.
  
* result: Object created by [[OpenDBX_result|odbx_result()]]
+
'''odbx_row_fetch()''' requires a valid '''result''' object which was created by [[OpenDBX_result|odbx_result()]]. It must not have been feed to [[OpenDBX result_free|odbx_result_free()]] before.
  
= Return values: =
+
= Return values =
  
* One on success
+
'''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.
* Zero if no more rows are available
+
* Less than zero if an error occured
+
  
= Errors: =
+
In case of an error, values less than zero are returned which encode the reason why the error occurred.
  
* -ODBX_ERR_PARAM: Parameter or its content is invalid
+
= Errors =
  
= See also: =
+
; -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 result_free|odbx_result_free()]].
  
* [[OpenDBX_column_count]]
+
= See also =
* [[OpenDBX_column_name]]
+
 
* [[OpenDBX_column_type]]
+
* [[OpenDBX column_count]]
* [[OpenDBX_field_length]]
+
* [[OpenDBX column_name]]
* [[OpenDBX_field_value]]
+
* [[OpenDBX column_type]]
 +
* [[OpenDBX error]]
 +
* [[OpenDBX field_length]]
 +
* [[OpenDBX field_value]]
 +
* [[OpenDBX result]]
  
  
 
----
 
----
 
Back to [[OpenDBX API|Overview]]
 
Back to [[OpenDBX API|Overview]]

Revision as of 21:58, 23 April 2007


#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 or 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 values

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 which encode 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



Back to Overview