MimerBeginStatement8

Prepares an SQL statement for execution. (UTF-8 version.)

Between the preparation and the time of execution, the application may supply any number of parameters to be used when executing the statement.

The same statement does not need to be prepared again, even if it is executed multiple times.

There is no need to prepare all statements at the start of the application.

Parameters

int32_t MimerBeginStatement8 (

            MimerSession sessionhandle,

            const char *sqlstatement,

            int32_t options,

            MimerStatement *statementhandle)

sessionhandle

in

A handle returned by MimerBeginSession[C], identifying the session.

sqlstatement

in

SQL statement string.

options

in

A bit mask of options identifying the characteristics of the statement. The following values specifies a cursor being scrollable, or forward only:

MIMER_FORWARD_ONLY (0x0)

MIMER_SCROLLABLE (0x1)

A value of 0 will indicate MIMER_FORWARD_ONLY.

statementhandle

out

A handle to the statement is returned here.

Returns

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

Return value

Description

MIMER_SUCCESS

Success.

MIMER_ILLEGAL_CHARACTER

The statement string contained an illegal character.

MIMER_HANDLE_INVALID

The sessionhandle parameter was not recognized as a handle.

MIMER_OUTOFMEMORY

If not enough memory could be allocated.

MIMER_STATEMENT_CANNOT_BE_PREPARED

The statement was a DDL statement which cannot be prepared. Such statements should be executed using MimerExecuteStatement.

MIMER_TRUNCATION_ERROR

The statement string was too long.

Other value < 0

Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Micro API compatible.

UTF-8 version of the routine. See Character String Formats for more information about character formats and the different routine versions.