MimerSetBinary

Sets a binary data parameter.

Only the SQL types BINARY and BINARY VARYING may be set using this call.

This routine may allocate additional memory to hold the parameter value, along with future output parameters and result set columns. This memory is freed when it is no longer needed, no later than when MimerEndStatement is called. This memory is also freed after a call to MimerExecute and MimerCloseCursor if there were no output parameters or result set columns.

Parameters

int32_t MimerSetBinary (

            MimerStatement statementhandle,

            int16_t param_no,

            const void *value,

            size_t size)

statementhandle

in

A handle returned by MimerBeginStatement[C|8], identifying a prepared statement.

param_no

in

A number identifying the parameter. First parameter is 1.

value

in

A pointer to a memory location holding the binary data.

(If this pointer is a null pointer, the parameter is set to the SQL null value.)

size

in

The maximum size of the binary data in bytes.

To set the parameter to the SQL null value, use the MimerSetNull function.

Returns

A negative value indicating an error, or zero if successful.

Return value

Description

MIMER_SUCCESS

Success.

MIMER_CAST_VIOLATION

If the referred database type was not BINARY or BINARY VARYING.

MIMER_HANDLE_INVALID

The statementhandle parameter was not recognized as a handle.

MIMER_NONEXISTENT_COLUMN_PARAMETER

The referenced parameter does not exist.

MIMER_NULL_VIOLATION

Cannot assign the null value to a non-nullable parameter

MIMER_OUTOFMEMORY

If not enough memory could be allocated.

MIMER_PARAMETER_NOT_INPUT

The referenced parameter is not an input or input/output parameter, which is required when calling a data input routine.

MIMER_TRUNCATION_ERROR

The input data was truncated.

Notes

Not Micro API compatible.