odbx_column_count(3)
π odbx_column_count(3) β the OpenDBX girlies' guide
okay so bestie, welcome to odbx_column_count, one of the OpenDBX crew β¨ if you've ever stared at a result set and gone "how many columns is this actually givingβ¦" β this is the function for you. no cap. π
πΈ NAME πΈ
odbx_column_count β get the number of columns in the current result set π
β¨ SYNOPSIS β¨
#include <opendbx/api.h>
int odbx_column_count (odbx_result_t* result);
like, that's the whole vibe. one include, one call. slay. π
π¦ DESCRIPTION π¦
So odbx_column_count() returns the number of columns that belong to the current result set β the one you already allocated with odbx_result(). π«Ά
And here's the tea: that number will never change within a result setβ¦ with one notable exception. π
π¨ The MySQL exception, fr fr: MySQL returns all the outstanding rows of a previous result set first if they weren't fetched completely by odbx_row_fetch() before. So yeah β in this special situation the column count might change. not a drill. π
Because of that, it is strongly advised to fetch all rows of a result set before calling odbx_result() again β because other backends will straight up return an error in this case. no vibes, just error. π
Also, the result parameter this function needs must be a valid result set returned by odbx_result(), and it must not have been fed to odbx_result_finish() before. like, don't ghost it and then come back. π
π₯ RETURN VALUE π₯
odbx_column_count() returns the number of columns/fields available in the current result set. π
The value depends on the column list that's part of the SELECT query, and it is zero if the query wasn't a SELECT-like query. yeah. zero. it's giving "nothing to see here". β
π ERRORS π
This function will also return zero if the result parameter is invalid. so if you get a zero and you're confusedβ¦ check your result, bestie. π
π SEE ALSO π
odbx_column_name()odbx_column_type()odbx_result()
the whole squad. iykyk. π§
mwah π that's it, that's the page β brought to you by OpenDBX, dated 6 February 2026. go forth and count those columns, icon. π¦β¨π
π¦ 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