---
name: "odbx_column_count"
section: "3"
platform: "linux"
package: "opendbx"
version: "1.4.6-13"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/odbx_column_count"
---

# odbx\_column\_count(3)

Get the number of columns in the current result set

## NAME

odbx\_column\_count - Get the number of columns in the current result set

## SYNOPSIS

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

FCint **odbx\_column\_count**F\[0\]  FC(odbx\_result\_t\* *result*);F\[0\]

## DESCRIPTION

Returns the number of columns which belongs to the current result set allocated by FC**odbx\_result**F\[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 FC**odbx\_row\_fetch**F\[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 FC**odbx\_result**F\[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 FC**odbx\_result**F\[0\]() and must not has been feed to FC**odbx\_result\_finish**F\[0\]() before.

## RETURN VALUE

FC**odbx\_column\_count**F\[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.

## SEE ALSO

FC**odbx\_column\_name**F\[0\](), FC**odbx\_column\_type**F\[0\](), FC**odbx\_result**F\[0\]()
