Reference

odbx_lo_open(3)

Opens a large object in the database

NAME

odbx_lo_open - Opens a large object in the database

SYNOPSIS

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

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

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_capabilitiesF[0]() provides the answer when feed with the FCODBX_CAP_LOF[0]

The FCresultF[0] parameter has to be the result object created and returned by FCodbx_resultF[0](). It becomes invalid after it was supplied to FCodbx_result_finishF[0]() and this function will return an error in that case. The second parameter, the pointer to a FCodbx_lo_tF[0]*, will contain the newly created large object handle if FCodbx_lo_openF[0]() succeeds. The FCloF[0] 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_valueF[0]() but you have to check for FCNULLF[0] values before feeding the value to FCodbx_lo_openF[0](). Otherwise, an error is returned.

RETURN VALUE

FCodbx_lo_openF[0]() returns FCODBX_ERR_SUCCESSF[0], 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_errorF[0]() and FCodbx_error_typeF[0]() to get further details.

ERRORS

-FCODBX_ERR_BACKENDF[0]

The native database library couldn't open the large object

-FCODBX_ERR_NOMEMF[0]

Allocating additionally required memory failed

SEE ALSO

FCodbx_capabilitiesF[0](), FCodbx_field_valueF[0](), FCodbx_lo_closeF[0](), FCodbx_lo_readF[0](), FCodbx_lo_writeF[0](), FCodbx_resultF[0]()

History