---
name: "odbx_field_length"
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_field_length"
---

# odbx\_field\_length(3)

Returns the length of a field value

## NAME

odbx\_field\_length - Returns the length of a field value

## SYNOPSIS

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

FCunsigned long **odbx\_field\_length**F\[0\]  FC(odbx\_result\_t\* *result*, unsigned long *pos*);F\[0\]

## DESCRIPTION

FC**odbx\_field\_length**F\[0\]() returns the length of the field value in bytes. The field is part of the current row which was retrieved by the latest call to FC**odbx\_row\_fetch**F\[0\]() and is specified by the column index given by FCposF\[0\].

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.

Valid column indices for the requested column provided via FCposF\[0\] start with zero and end with the value returned by FC**odbx\_column\_count**F\[0\]() minus one.

## RETURN VALUE

The FC**odbx\_field\_length**F\[0\]() function provides the number of bytes of the specified field to the caller. If the field value consists of character data, the returned length will be without the terminating zero character. For binary values the exact size of the block as stored in the database is returned.

## ERRORS

This function will also return zero if the FCresultF\[0\] parameter is invalid or if the value of FCposF\[0\] is out of range.

## SEE ALSO

FC**odbx\_field\_value**F\[0\](), FC**odbx\_result**F\[0\]()
