odbx_lo_open(3)

NAME
odbx_lo_open - Opens a large object in the database

SYNOPSIS
\FC#include <opendbx/api.h>\F[]

\FCint odbx_lo_open\F[]
\FC(odbx_result_t* result, odbx_lo_t** lo, const char* value);\F[]

DESCRIPTION
Some database management systems store large amount of data in separate regions of the database and the content is only referenced by identifiers in the tables. The data types used for this are called Binary Large OBject (BLOB) and Character Large OBject (CLOB) and can be found in e.g. the Firebird and Oracle database servers. The OpenDBX library provides a large object interface to access, read and write their content via the "odbx_lo_*()" functions. To find out if large amount of data can be accessed directly or if the large object interface have to be used, \FCodbx_capabilities\F[]() provides the answer when feed with the \FCODBX_CAP_LO\F[]

The \FCresult\F[] parameter has to be the result object created and returned by \FCodbx_result\F[](). It becomes invalid after it was supplied to \FCodbx_result_finish\F[]() and this function will return an error in that case. The second parameter, the pointer to a \FCodbx_lo_t\F[]*, will contain the newly created large object handle if \FCodbx_lo_open\F[]() succeeds. The \FClo\F[] handle is necessary for all other functions of the large object interface so they are able to perform their operations on the referenced content. The last parameter must be the return value of \FCodbx_field_value\F[]() but you have to check for \FCNULL\F[] values before feeding the value to \FCodbx_lo_open\F[](). Otherwise, an error is returned.

RETURN VALUE
\FCodbx_lo_open\F[]() returns \FCODBX_ERR_SUCCESS\F[], or an error code whose value is less than zero 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 \FCodbx_error\F[]() and \FCodbx_error_type\F[]() to get further details.

ERRORS

-\FCODBX_ERR_BACKEND\F[]
    The native database library couldn't open the large object

-\FCODBX_ERR_NOMEM\F[]
    Allocating additionally required memory failed

SEE ALSO
\FCodbx_capabilities\F[](), \FCodbx_field_value\F[](), \FCodbx_lo_close\F[](), \FCodbx_lo_read\F[](), \FCodbx_lo_write\F[](), \FCodbx_result\F[]()