Difference between revisions of "OpenDBX/C API/odbx column count"
(enhanced article) |
(header hierarchy) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | |||
'''#include <odbx.h>''' | '''#include <odbx.h>''' | ||
Line 6: | Line 5: | ||
odbx_result_t* '''result''' ) | odbx_result_t* '''result''' ) | ||
− | = Description = | + | == Description == |
Returns the number of columns which belongs to the current result set allocated by [[OpenDBX result|odbx_result()]]. The number won't change within a result set with one notable exception: MySQL returns all outstanding rows of a previous result set first if they were not fetched completely by [[OpenDBX row_fetch|odbx_row_fetch()]] before. Therefore, the column count might change in this special situation. It is strongly advised to fetch all rows of a result set before calling [[OpenDBX result|odbx_result()]] again because other backends will return an error in this case. | Returns the number of columns which belongs to the current result set allocated by [[OpenDBX result|odbx_result()]]. The number won't change within a result set with one notable exception: MySQL returns all outstanding rows of a previous result set first if they were not fetched completely by [[OpenDBX row_fetch|odbx_row_fetch()]] before. Therefore, the column count might change in this special situation. It is strongly advised to fetch all rows of a result set before calling [[OpenDBX result|odbx_result()]] again because other backends will return an error in this case. | ||
Line 12: | Line 11: | ||
The '''result''' parameter required by this function must be a valid result set returned by [[OpenDBX result|odbx_result()]] and must not have been feed to [[OpenDBX result_free|odbx_result_free()]] before. | The '''result''' parameter required by this function must be a valid result set returned by [[OpenDBX result|odbx_result()]] and must not have been feed to [[OpenDBX result_free|odbx_result_free()]] before. | ||
− | = Return values = | + | == Return values == |
'''opendbx_column_count()''' returns the number of columns/fields which are available in the current result set. The value depend on the column list being part of the SELECT query and it is zero if the query wasn't a SELECT-like query. | '''opendbx_column_count()''' returns the number of columns/fields which are available in the current result set. The value depend on the column list being part of the SELECT query and it is zero if the query wasn't a SELECT-like query. | ||
− | = Errors = | + | == Errors == |
This function will also return zero if the '''result''' parameter is invalid. | This function will also return zero if the '''result''' parameter is invalid. | ||
− | = See also = | + | == See also == |
* [[OpenDBX column_name|odbx_column_name()]] | * [[OpenDBX column_name|odbx_column_name()]] |
Revision as of 18:32, 6 May 2007
#include <odbx.h> unsigned long odbx_column_count( odbx_result_t* result )
Description
Returns the number of columns which belongs to the current result set allocated by odbx_result(). The number won't change within a result set with one notable exception: MySQL returns all outstanding rows of a previous result set first if they were not fetched completely by odbx_row_fetch() before. Therefore, the column count might change in this special situation. It is strongly advised to fetch all rows of a result set before calling odbx_result() again because other backends will return an error in this case.
The result parameter required by this function must be a valid result set returned by odbx_result() and must not have been feed to odbx_result_free() before.
Return values
opendbx_column_count() returns the number of columns/fields which are available in the current result set. The value depend on the column list being part of the SELECT query and it is zero if the query wasn't a SELECT-like query.
Errors
This function will also return zero if the result parameter is invalid.
See also
Back to Overview