SYNOPSIS

\*(T<#include <opendbx/api.h>\*(T>

\*(T<ssize_t odbx_lo_write\*(T> \kx \*(T<(odbx_lo_t* lo, void* buffer, size_t buflen);\*(T>

DESCRIPTION

\*(T<odbx_lo_write\*(T>() sends the data supplied in \*(T<buffer\*(T> 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 \*(T<lo\*(T> parameter has to be the large object handle created and returned by \*(T<odbx_lo_open\*(T>() via its second parameter. It becomes invalid after it was supplied to \*(T<odbx_lo_close\*(T>() and this function will return an error in this case. The data which should be send to the server is read from \*(T<buffer\*(T> up to \*(T<buflen\*(T> bytes.

RETURN VALUE

\*(T<odbx_lo_write\*(T>() returns the number of bytes read from \*(T<buffer\*(T> and sent to the database server, which may be up to \*(T<buflen\*(T> 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 \*(T<buflen\*(T>. 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 \*(T<odbx_error\*(T>() and \*(T<odbx_error_type\*(T>() to get further details.

ERRORS

-\*(T<ODBX_ERR_BACKEND\*(T>

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

-\*(T<ODBX_ERR_HANDLE\*(T>

\*(T<lo\*(T> is NULL or the supplied large object handle is invalid

RELATED TO odbx_lo_write…

\*(T<odbx_lo_open\*(T>(), \*(T<odbx_lo_close\*(T>()