Obtains a large object handle.
Only the SQL data types BINARY LARGE OBJECT, CHARACTER LARGE OBJECT and NATIONAL CHARACTER LARGE OBJECT may be retrieved using this call.
Whenever a large object is about to retrieved from the database, this routine obtains the object from the result set row, and the length is returned. Subsequent calls to MimerGetBlobData or MimerGetNclobData retrieves the actual object from the database.
If there are any other open large object handles on this statement, these are closed before returning the new one.
Note that if this routine returns a size or length of 0, it is strictly not required to call the MimerGetBlobData or MimerGetNclobData routines for the large object contents, thus a database server round-trip may be saved.
Parameters
MimerStatement statementhandle,
int16_t colno,
size_t *size_length,
MimerLob *lobhandle)
statementhandle |
in |
A handle returned by MimerBeginStatement[C|8], identifying a statement that have been executed. |
colno |
in |
The column number to get data from. First column is 1. |
size_length |
out |
The size of a BINARY LARGE OBJECT in bytes or the length of a CHARACTER LARGE OBJECT or a NATIONAL CHARACTER LARGE OBJECT. |
lobhandle |
out |
A handle to the binary large object. |
Returns
A negative value indicating an error, or zero if successful.
Return value |
Description |
---|---|
MIMER_SUCCESS |
Success. |
MIMER_CAST_VIOLATION |
If the output parameter or column was not of the BINARY LARGE OBJECT, CHARACTER LARGE OBJECT or NATIONAL CHARACTER LARGE OBJECT data types. |
MIMER_HANDLE_INVALID |
The statementhandle parameter was not recognized as a handle. |
MIMER_NONEXISTENT_COLUMN_PARAMETER |
The supplied column or parameter number did not exist. |
MIMER_PARAMETER_NOT_OUTPUT |
The referenced parameter is not an output or input/output parameter, which is required when calling a data output routine. |
MIMER_SEQUENCE_ERROR |
If the statement cursor is not open, or the current row is before the first row of the result set, or after the last row of the result set. |
MIMER_SQL_NULL_VALUE |
The column or output parameter contained the SQL null value. (This can also be detected using the MimerIsNull routine.) |
Notes
Not Micro API compatible.