odbx_column_count(3)

odbx_column_count3

Get the number of columns in the current result set

Usage

FC#include <opendbx/api.h>F[0]

FCint odbx_column_countF[0] FC(odbx_result_t* result);F[0]

Overview

Returns the number of columns which belongs to the current result set allocated by FCodbx_resultF[0](). The number will never 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 FCodbx_row_fetchF[0]() 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 FCodbx_resultF[0]() again because other backends will return an error in this case.

The FCresultF[0] parameter required by this function must be a valid result set returned by FCodbx_resultF[0]() and must not has been feed to FCodbx_result_finishF[0]() before.

Return value

FCodbx_column_countF[0]() returns the number of columns/fields which are available in the current result set. The value depends 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 FCresultF[0] parameter is invalid.

Releases

7 releases since Debian 8 (Jessie); the text changed 6 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13
  7. Arch

From opendbx 1.4.6-13 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.