---
name: "odbx_error"
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_error"
---

# odbx\_error(3)

Returns a human readable error message

## NAME

odbx\_error - Returns a human readable error message

## SYNOPSIS

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

FCchar\* **odbx\_error**F\[0\]  FC(odbx\_t\* *handle*, int *error*);F\[0\]

## DESCRIPTION

FC**odbx\_error**F\[0\]() returns an error string corresponding to the supplied error code or the error string generated by the native database library. Error strings originating from the backend modules or the native database client libraries are cleared as soon as the next odbx\_\*() function is called. All error strings are statically allocated and must not be changed or freed. If the OpenDBX library is compiled with native language support and the user environment variables are set accordingly to a supported language, strings which are part of the OpenDBX library are translated before being returned. This may also be the case for strings returned by the native database libraries but depends on their support.

The first parameter FChandleF\[0\] is the connection object created and returned by FC**odbx\_init**F\[0\]() which becomes invalid as soon as it was supplied to FC**odbx\_finish**F\[0\](). Anyhow, it isn't necessary to supply a valid handle for errors which use error codes not equal to -FCODBX\_ERR\_BACKENDF\[0\] because they are returned directly from a static error message array. Therefore, it's possible to use FC**odbx\_error**F\[0\]() even if FC**odbx\_init**F\[0\]() wasn't successful. If -FCODBX\_ERR\_BACKENDF\[0\] is supplied in this case nevertheless, the return error string will be the same as for an invalid handle.

Almost all OpenDBX library functions return an FCerrorF\[0\] code if one of the operations couldn't be completed successfully. The codes returned use values less than zero to indicate different kind of errors and these values can be directly passed to FC**odbx\_error**F\[0\]() to obtain the corresponding zero-terminated error string.

## RETURN VALUE

FC**odbx\_error**F\[0\]() returns a zero-terminated string suitable for being displayed to the user of the application.

## ERRORS

If an backend error occurred and FChandleF\[0\] is NULL or the supplied connection object is invalid, FC**odbx\_error**F\[0\]() returns the localized string for -FCODBX\_ERR\_PARAMF\[0\].

## SEE ALSO

FC**odbx\_error\_type**F\[0\](), FC**odbx\_init**F\[0\]()
