odbx_row_fetch(3)
π odbx_row_fetch β OpenDBX, section 3 π
okay bestie, so you're poking at OpenDBX (that's the manual, section 3, iykyk) and you wanna know how to actually get rows out of a result set. This is the function. Sit down, hydrate, let's go β¨
π¦ NAME π¦
odbx_row_fetch β retrieve rows from the result set. literally its whole job, no cap π
π SYNOPSIS π
#include <opendbx/api.h>
int odbx_row_fetch (odbx_result_t* result);
β¨ DESCRIPTION β¨
So here's the tea π: odbx_row_fetch() grabs the values of a row from the current result set β the one that came back from odbx_result().
And listen, bestie, this part matters: until you invoke this function, there's no row data and no field data available at all. Like, none. If you go poking at odbx_field_length() or odbx_field_value() before fetching, they will just hand you zero and NULL respectively. The vibe check is empty. π
Also, you have to fetch all the rows from a result set until you get a zero back (that's the "no more rows, we're done here" signal). Why? Because otherwise β and this is backend-dependent, so it's giving "your mileage may vary" β an error may occur after you call odbx_result() the next time, or the outstanding rows will show up inside the next result. Messy. Not iconic. Avoid. π
One more thing: odbx_row_fetch() requires a valid result object, and that object has to have been created by odbx_result(). It must not have been handed off to odbx_result_finish() beforehand β that's a hard no. π₯
π RETURN VALUE π
odbx_row_fetch() returns ODBX_ROW_NEXT ("1") for as long as rows are still available from the result set. Slay. π
Once the last row has been made available, any further calls to this function return ODBX_ROW_DONE ("0"), which is literally telling you the result set doesn't contain any more rows. Periodt.
ngl, the named constants are only available since OpenDBX 1.3.2 β if a previous release is the basis for your application development, you have to use the numbers in brackets instead. No cap, the numbers are"1"and"0". π
And if something goes sideways, values less than zero are returned, encoding the reason why the error occurred. π
π ERRORS π
-ODBX_ERR_PARAMβ theresultparameter is eitherNULLor the object is invalid. This is usually the case ifresulthas already been fed toodbx_result_finish(). (We warned you, bestie. π«Ά)
πΈ SEE ALSO πΈ
odbx_column_count()odbx_column_name()odbx_column_type()odbx_error()odbx_error_type()odbx_field_length()odbx_field_value()odbx_result()
k that's the whole page, you're so welcome π this was the OpenDBX manual, dated 6 February 2026 β go forth and fetch those rows responsibly, main character energy only ππ¦β
π¦ where this page comes from
- ubuntu resolute: libopendbx1-dev 1.4.6-18build2
- ubuntu stonking: libopendbx1-dev 1.4.6-18build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms