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 β€” the result parameter is either NULL or the object is invalid. This is usually the case if result has already been fed to odbx_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