---
name: "odbx_lo_write"
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_lo_write"
---

# odbx\_lo\_write(3)

Writes buffer content into the large object

## NAME

odbx\_lo\_write - Writes buffer content into the large object

## SYNOPSIS

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

FCssize\_t **odbx\_lo\_write**F\[0\]  FC(odbx\_lo\_t\* *lo*, void\* *buffer*, size\_t *buflen*);F\[0\]

## DESCRIPTION

FC**odbx\_lo\_write**F\[0\]() sends the data supplied in FCbufferF\[0\] to the server for storing it inside the large object. The function can be called more than once to add subsequent parts of the content to the object. If it isn't a new or empty object, the existing data will be overwritten and truncated to the new size. It's not possible to update only parts of the content as some databases doesn't support to position the internal file position indicator.

The FCloF\[0\] parameter has to be the large object handle created and returned by FC**odbx\_lo\_open**F\[0\]() via its second parameter. It becomes invalid after it was supplied to FC**odbx\_lo\_close**F\[0\]() and this function will return an error in this case. The data which should be send to the server is read from FCbufferF\[0\] up to FCbuflenF\[0\] bytes.

## RETURN VALUE

FC**odbx\_lo\_write**F\[0\]() returns the number of bytes read from FCbufferF\[0\] and sent to the database server, which may be up to FCbuflenF\[0\] bytes. It isn't guaranteed that the complete chunk was sent to the server, so the returned size may be less than the value in FCbuflenF\[0\]. On error, a code whose value is less than zero is returned if one of the operations couldn't be completed successfully. Possible error codes are listed in the error section and they can be feed to FC**odbx\_error**F\[0\]() and FC**odbx\_error\_type**F\[0\]() to get further details.

## ERRORS

- \-FCODBX\_ERR\_BACKENDF\[0\]

  The native database library couldn't write to the large object successfully

- \-FCODBX\_ERR\_HANDLEF\[0\]

  FCloF\[0\] is NULL or the supplied large object handle is invalid

## SEE ALSO

FC**odbx\_lo\_open**F\[0\](), FC**odbx\_lo\_close**F\[0\]()
