Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Micro API Specification


The following routines are included in the Micro API:

Routine
Description
Mimer SQL Auto compatible
Starts a session with the database. (wchar_t version.)
Yes
Starts a session with the database. (char version.)
Yes
Prepares a statement for execution. (wchar_t version.)
Yes
Prepares a statement for execution. (char version.)
Yes
Starts a transaction.

Closes an open cursor.
Yes
Obtains the number of columns in a result set.

Obtains the name of a column. (wchar_t version.)

Obtains the name of a column. (char version.)

Returns the type of a column.

Returns the current row of a result set.

Ends a database session.
Yes
Closes a prepared statement.
Yes
Commits or rollbacks a transaction.

Executes a statement that does not return a result set.
Yes
Executes a statement directly without parameters. (wchar_t version.)
Yes
Executes a statement directly without parameters. (char version.)
Yes
Advances to the next row of the result set.
Yes
Moves the current cursor position on a scrollable cursor.

Advances to the next row of the result set but optionally skips a number of rows in the result set.
Yes
Gets binary data from a result set or an output parameter.
Yes
Retrieves the content of a binary large object.

Gets boolean data from a result set or an output parameter.
Yes
Retrieves the contents of a character large object. (wchar_t version.)

Retrieves the contents of a character large object. (char version.)

Gets double precision float data from a result set or an output parameter.
Yes
Gets single precision float data from a result set or an output parameter.
Yes
Gets int32_t integer data from a result set or an output parameter.
Yes
Gets int64_t integer (long long) data from a result set or an output parameter.
Yes
Obtains a large object handle.

Obtains server statistics information.
Yes
Gets character data from a result set or an output parameter. (wchar_t version.)
Yes
Gets character data from a result set or an output parameter into a multi byte character string. (char version.)
Yes
Checks if a result set column or output parameter has the SQL null value.
Yes
Advances the current row to the next row, within the current array.

Opens a result set.
Yes
Returns the number of parameters for a statement.

Obtains the data type of a parameter.

Returns the maximum number of bytes required to hold one row of data.

Sets the maximum number of rows to retrieve in each server request.

Sets a binary data parameter.
Yes
Sets the data of a binary large object.

Sets a boolean data parameter.
Yes
Sets the data of a character large object. (wchar_t version.)

Sets the data of a character large object. (char version.)

Sets a double precision floating point parameter.
Yes
Sets a single precision floating point parameter.
Yes
Sets an int32_t integer parameter.
Yes
Sets an int64_t integer parameter.
Yes
Sets a large object in the database.

Sets an input parameter to the SQL null value.
Yes
Sets a string parameter. (wchar_t version.)
Yes
Sets a string parameter. (char version.)
Yes
Sets a string parameter. (wchar_t version.)

Sets a string parameter. (char version.)

MimerBeginSession

Starts a session with the database.

Parameters

 int32_t MimerBeginSession (
             const wchar_t *database,
             const wchar_t *ident,
             const wchar_t *password,
             MimerSession *sessionhandle)

database
in
The name of the database to connect to. If this is null, a connection to the default database is created.
ident
in
The ident associated with the session to create. This parameter may not be null.
password
in
The password of the ident. A null value is identical to a zero length password. Database servers which do not enforce authentication control may ignore the password.
sessionhandle
out

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_OUTOFMEMORY
Out of memory.
MIMER_ILLEGAL_CHARACTER
One of the string parameters database, ident or password contained an illegal character.
< 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerBeginSessionC

Starts a session with the database.

Parameters

 int32_t MimerBeginSessionC (
             const char *database,
             const char *ident,
             const char *password,
             MimerSession *sessionhandle)

database
in
The name of the database to connect to. If this is null, a connection to the default database is created.
ident
in
The ident associated with the session to create. This parameter may not be null.
password
in
The password of the ident. A null value is identical to a zero length password. Database servers which do not enforce authentication control may ignore the password.
sessionhandle
out

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_OUTOFMEMORY
Out of memory.
MIMER_ILLEGAL_CHARACTER
One of the string parameters database, ident or password contained an illegal character.
< 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerBeginStatement

Prepares an SQL statement for execution.

Between the preparation and the time of execution, the application may supply any number of input 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. However, all input parameters have to be set again before each execution.

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

Parameters

 int32_t MimerBeginStatement (
             MimerSession sessionhandle,
             const wchar_t *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[C].
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.

Mimer SQL Auto compatible.

MimerBeginStatementC

Prepares an SQL statement for execution.

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 MimerBeginStatementC (
             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.

Mimer SQL Auto compatible.

MimerBeginTransaction

Starts a transaction.

This routine only needs to be called if two or more database operations should participate in the transaction. (If the transaction consists of one single operation, simply use the auto-commit functionality, which is the default. See Transactions.)

Parameters

 int32_t MimerBeginTransaction (
             MimerSession sessionhandle,
             int32_t transoption)

sessionhandle
in
A handle returned by MimerBeginSession[C], identifying the session.
transoption
in
A bit mask of options identifying the characteristics of the transaction.The following values specifies a transaction being read/write, or read only:
MIMER_TRANS_READWRITE (0x0)
MIMER_TRANS_READONLY (0x1)
A value of 0 will indicate MIMER_TRANS_READWRITE.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The sessionhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerCloseCursor

Closes an open cursor.

When the cursor is closed, all resources held by the result set are released.

After the cursor is closed, the cursor may either be reopened using a call to MimerOpenCursor or the statement should be released using a call to MimerEndStatement. Before the cursor is reopened, a new set of parameters may be supplied using any of the data input functions.

Parameters

 int32_t MimerCloseCursor (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_SEQUENCE_ERROR
If the statement cursor is not open.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerColumnCount

Obtains the number of columns in a result set.

Parameters

 int32_t MimerColumnCount (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.

Returns

If zero or positive, the number of result set columns. If negative a standard Mimer error code.

Return value
Description
>= 0
The number of result set columns.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
The statement is not compiled.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

Not Mimer SQL Auto compatible.

MimerColumnName

Obtains the name of a column.

Parameters

 int32_t MimerColumnName (
             MimerStatement statementhandle,
             int16_t column,
             wchar_t *columnname,
             size_t maxlen)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
column
in
The column number, where the leftmost column is 1.
columnname
out
The area where to return the column name. The maximum column name length returned is maxlen-1.
maxlen
in
The size of the columnname area.

Returns

Returns the number of characters in the column name. If this value is larger than maxlen-1, a truncation occurred. If a negative value was returned, there was an error.

Return value
Description
>= 0
Length of column name (in characters)
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
Statement is not compiled
MIMER_NONEXISTENT_COLUMN_PARAMETER
The column number does not exist
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

Not Mimer SQL Auto compatible.

MimerColumnNameC

Obtains the name of a column in a multibyte character string.

Parameters

 int32_t MimerColumnNameC (
             MimerStatement statementhandle,
             int16_t column,
             char *columnname,
             size_t maxsiz)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
column
in
The column number, where the leftmost column is 1.
columnname
out
The are where to return the column name. The maximum column name length returned is maxsiz-1.
maxsiz
in
The size of the columnname area.

Returns

Returns the size of the column name in bytes. If this value is larger than maxsiz-1, a truncation occurred. If a negative value was returned, there was an error.

Return value
Description
>= 0
Length of column name (in characters)
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
Statement is not compiled.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The column number does not exist.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

Not Mimer SQL Auto compatible.

MimerColumnType

Returns the type of a column.

Parameters

 int32_t MimerColumnType (
             MimerStatement statementhandle,
             int16_t column)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
column
in
The column number, where the leftmost column is 1.

Returns

Returns the column type or a negative value if an error occurred.

Return value
Description
> 0
Data type. See list in Data Types.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
Statement is not compiled
MIMER_NONEXISTENT_COLUMN_PARAMETER
The column number does not exist
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

Not Mimer SQL Auto compatible.

MimerCurrentRow

Returns the current row of a result set.

Parameters

 int32_t MimerCurrentRow (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.

Returns

A negative value indicate an error code. Zero or a positive value indicates the current cursor position.

Return value
Description
>= 0
Current cursor position.
If the current position is before the result set, 0 is returned. A value of 1 indicates the first row of the result set.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
If the statement cursor is not open.

Notes

Not Mimer SQL Auto compatible.

MimerEndSession

Ends a database session.

If there are any active transactions, these are rollbacked.

Parameters

 int32_t MimerEndSession (MimerSession *sessionhandle)

sessionhandle
in
A reference to a handle returned by MimerBeginSession[C], identifying the session.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The sessionhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
If there are open statements on the session. Use MimerEndStatement to release them.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerEndStatement

Closes a prepared statement.

If there is an open cursor on this statement, it is automatically closed.

Parameters

 int32_t MimerEndStatement (MimerStatement *statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerEndTransaction

Commits or rollbacks a transaction.

Open cursors are automatically closed.

Parameters

 int32_t MimerEndTransaction (
             MimerSession sessionhandle,
             int32_t commit_rollback)

sessionhandle
in
A handle returned by MimerBeginSession[C] identifying the session.
commit_rollback
in
An integer specifying the transaction operation to perform. MIMER_COMMIT and MIMER_ROLLBACK are recognized.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The sessionhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
No transaction has been started.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerExecute

Execute a statement that does not return a result set.

Statements that do not return a result set include data manipulation statements (INSERT, UPDATE, DELETE), assignments (SET) and procedure calls (CALL). (Statements that return a result set are handled using cursors. See Result set producing statements.)

Before calling MimerExecute, set all input parameters of the statement using data input routines. (See Data Input Routines.)

If this call returns successfully, any output parameters may be retrieved using data output routines. (See Data Output Routines.)

Parameters

 int32_t MimerExecute (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.

Returns

A negative value indicating an error, or zero if successful. A positive value indicates an update row count returned by the database.

Return value
Description
> 0
Success. Value indicates an update row count.
MIMER_SUCCESS
Success.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
MIMER_SEQUENCE_ERROR
If this routine is called on a statement which returns a result set.
MIMER_UNSET_PARAMETERS
All input parameters have not yet been set.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerExecuteStatement

Executes a statement directly without parameters.

This routine is mainly intended for data definition statements (e.g. CREATE TABLE), but can also be used for regular INSERT, UPDATE and DELETE statements with no input or output parameters.

Parameters

 int32_t MimerExecuteStatement (
             MimerSession sessionhandle,
             const wchar_t *sqlstatement)

sessionhandle
in
A handle returned by MimerBeginSession[C], identifying the session.
sqlstatement
in
An SQL statement.

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_STRING_TRUNCATION
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.

Mimer SQL Auto compatible.

MimerExecuteStatementC

Executes a statement directly without parameters.

This routine is mainly intended for data definition statements (e.g. CREATE TABLE), but can also be used for regular INSERT, UPDATE and DELETE statements with no input or output parameters.

Parameters

 int32_t MimerExecuteStatementC (
             MimerSession sessionhandle,
             const char *sqlstatement)

sessionhandle
in
A handle returned by MimerBeginSession[C], identifying the session.
sqlstatement
in
An SQL statement.

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_STRING_TRUNCATION
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.

Mimer SQL Auto compatible.

MimerFetch

Advances to the next row of the result set.

If the routine returns successfully, the current row has been advanced one row down the result set. Column data may be retrieved using data output routines.

Parameters

 int32_t MimerFetch (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement with an open cursor.

Returns

A negative value indicating an error, or zero if successful. A value of MIMER_NO_DATA indicates that the end of the result has been reached.

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
If there is no open result set on this statement.
MIMER_NO_DATA
If there are no more rows in the result set.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerFetchScroll

Moves the current cursor position on a scrollable cursor.

A non-scrollable cursor (MIMER_FORWARD_ONLY) may only be read using scroll operation MIMER_NEXT.

Parameters

 int32_t MimerFetchScroll (
             MimerStatement statementhandle,
             int32_t operation,
             int32_t offset)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
operation
in
A value describing the scroll operation to perform. This value may be either of the following:
MIMER_RELATIVE (0x00000000) - Move to a row number relative to the current position.
MIMER_NEXT (0x00000001) - Move on to the next row.
MIMER_PREVIOUS (0xffffffff) - Move to the previous row.
MIMER_ABSOLUTE (0x40000000) - Move to an absolute row number.
MIMER_FIRST (0x40000001) - Move to the first row of the result set.
MIMER_LAST (0xbfffffff) - Move to the last row of the result set.
offset
in
A parameter to MIMER_RELATIVE and MIMER_ABSOLUTE operation codes.
A relative value of n will move the cursor n rows relative to the current row. An absolute value of n will move to the n:th row of the result set. See Scrolling through a result set for an example of scroll operations.

Returns

A negative value indicating an error, or zero if successful. A value of MIMER_NO_DATA indicates that the end of the result has been reached.

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
There is no open scrollable cursor this statement. Scrollability is determined at compile time with the options parameter to MimerBeginStatement or MimerBeginStatementC.
MIMER_NO_DATA
If the scroll operation ended up on a row without data, that is either before or after the result set.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerFetchSkip

Advances to the next row of the result set but optionally skips a number of rows in the result set.

If the routine returns successfully, the current row has been advanced the specified number of rows down the result set. Column data may be retrieved using any of the data output functions.

Parameters

 int32_t MimerFetchSkip (
             MimerStatement statementhandle,
             int32_t count)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement with an open cursor.
count
in
Number of rows to advance the current row down the result set.

Returns

A negative value indicating an error, or zero if successful. A value of MIMER_NO_DATA indicates that the end of the result has been reached.

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NO_DATA
If there are no more rows in the result set.
MIMER_SEQUENCE_ERROR
If there is no open result set on this statement.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerGetBinary

Gets binary data from a result set or an output parameter.

Only SQL data types BINARY and BINARY VARYING may be retrieved using this routine.

Parameters

 int32_t MimerGetBinary (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             void *dest,
             size_t dest_maxsiz)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
dest
out
A memory location where to place output binary data. If this is null, no data will be returned, but the size of the binary data is still returned by this routine.
dest_maxsiz
in
The maximum size of the dest memory location in bytes.

Returns

A negative value indicating error, or a non-negative value indicating the number of bytes in the binary column.

Return value
Description
>= 0
The number of bytes in the binary column. If this value is larger than the dest_maxsiz parameter, the output data was truncated.
MIMER_CAST_VIOLATION
If the output parameter or column was not of the BINARY or BINARY VARYING 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

Mimer SQL Auto compatible.

MimerGetBlobData

Retrieves the content of a binary large object.

If the binary large object is to be retrieved in multiple chunks, chunks are retrieved in sequence, where the length of each chunk is specified by the length parameter of each call to this routine. Chunks may only be retrieved sequentially through the binary large object.

Parameters

 int32_t MimerGetBlobData (
             MimerLob *blobhandle,
             void *data,
             size_t size)

blobhandle
in
A reference to a binary large object handle created by MimerGetLob.
data
out
Where to place the entire or a part of the binary large object.
size
in
The size in bytes to retrieve in this chunk.

Returns

A negative value indicating error, or a non-negative value indicating the number of bytes available to return.

Return value
Description
>= 0
The number of bytes available to return. This includes the number of bytes returned in this call and all data that are left in the BLOB.
When the returned value is equal or less than the size input parameter, all data of the BLOB has been returned.
MIMER_HANDLE_INVALID
The blobhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerGetBoolean

Gets boolean data from a result set or an output parameter.

Only the database data type BOOLEAN may be retrieved using this call.

Parameters

 int32_t MimerGetBoolean (
             MimerStatement statementhandle,
             int16_t paramno_colno)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.

Returns

The value 0 for FALSE, the value 1 for TRUE, or a negative value indicating an error.

Return value
Description
1
Boolean value TRUE.
0
Boolean value FALSE.
MIMER_CAST_VIOLATION
If the output parameter or column was not of the BOOLEAN data type.
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

Mimer SQL Auto compatible.

MimerGetDouble

Gets double precision floating point data from a result set or an output parameter.

Only the SQL data types DOUBLE PRECISION and REAL may be retrieved using this call.

Parameters

 int32_t MimerGetDouble (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             double *value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
value
out
A memory location where to place the double precision floating point value.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_CAST_VIOLATION
If the output value was not of the DOUBLE PRECISION or REAL 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 Mimer SQL Auto compatible.

MimerGetFloat

Gets single precision floating point data from a result set or an output parameter.

Only the SQL data types DOUBLE PRECISION and REAL may be retrieved using this call.

Parameters

 int32_t MimerGetFloat (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             double *value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
value
out
A memory location where to place the floating point value.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_CAST_VIOLATION
If the output value was not of the DOUBLE PRECISION or REAL 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

Mimer SQL Auto compatible.

MimerGetInt32

Gets integer data from a result set or an output parameter.

Only the SQL data types INTEGER, BIGINT and SMALLINT may be get using this call.

Parameters

 int32_t MimerGetInt32 (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             int32_t *value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
value
out
A memory location where to place the integer.

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 INTEGER, BIGINT or SMALLINT 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

Mimer SQL Auto compatible.

MimerGetInt64

Gets int64_t integer data from a result set or an output parameter.

Only the SQL data types INTEGER, BIGINT and SMALLINT may be retrieved using this call.

Parameters

 int32_t MimerGetInt64 (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             int64_t *value)

 
statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
value
out
A memory location where to place the integer value.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_CAST_VIOLATION
If the value was not of the INTEGER, BIGINT or SMALLINT 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

Mimer SQL Auto compatible.

MimerGetLob

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

 int32_t MimerGetLob (
             MimerStatement statementhandle,
             int16_t colno,
             size_t *size_length,
             MimerLob *lobhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], 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 Mimer SQL Auto compatible.

MimerGetNclobData

Retrieves the contents of a character large object.

A character large object may be retrieved in one or more chunks.

If the character large object is to be retrieved in multiple chunks, chunks are retrieved in sequence, where the length of each chunk is specified by the length parameter of each call to this routine. Chunks may only be retrieved sequentially through the character large object.

Parameters

 int32_t MimerGetNclobData (
             MimerLob *clobhandle,
             wchar_t *data,
             size_t size)
 
clobhandle
in
A handle to a character large object returned by a call to MimerSetLob.
data
out
Where to place the entire or a part of the character large object.
size
in
The maximum number of bytes to retrieve, including terminating null. That is, if this parameter is n, the next n-1 characters are retrieved from the large object.

Returns

A negative value indicating error, or a non-negative value indicating the number of characters available to return. This includes the number of characters returned in this call (excluding terminating null) and all data that are left in the character object. When the returned value is less than the length input parameter, all data of the character object has been returned.

This value may be used to calculate how many characters (excluding terminating zero) that were returned using this formula:

 returned_characters = min(length_input_parameter-1,return_value)
 

The following formula may be used to calculate the number of characters left to return:

 left_to_return = return_value-length_input_parameter+1
 

Return value
Description
> 0
The number of characters left to return.
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The clobhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerGetNclobDataC

Retrieves the contents of a character large object.

A character large object may be retrieved in one or more chunks.

If the character large object is to be retrieved in multiple chunks, chunks are retrieved in sequence, where the length of each chunk is specified by the length parameter of each call to this routine. Chunks may only be retrieved sequentially through the character large object.

Parameters

 int32_t MimerGetNclobDataC (
             size_t *returned,
             MimerLob clobhandle,
             char *data,
             size_t length)
 
returned
out
The number of bytes, excluding terminating zero, returned as a result of the operation.
clobhandle
in
A handle to a character large object returned by a call to MimerSetLob.
data
out
Where to place the entire or a part of the character large object.
length
in
The number of characters to retrieve, including terminating null.

Returns

A negative value indicating error, or a non-negative value indicating the number of characters available to return. This includes the number of characters returned in this call (excluding terminating null) and all data that are left in the character object. When the returned value is less than the length input parameter, all data of the character object has been returned.

This value may be used to calculate how many characters (excluding terminating null) that were returned using this formula:

 returned_characters = min(length_input_parameter-1,return_value)
 

The following formula may be used to calculate the number of characters left to return:

 left_to_return = return_value-length_input_parameter+1
 

Return value
Description
>= 0
Success.
The number of characters to return. (See description above.)
MIMER_HANDLE_INVALID
The clobhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerGetStatistics

Obtains server statistics information.

Statistics is returned in the form of counters. Counters may either be an absolute value representing the current status or a monotonically increasing value representing the number of occurred events since the server started. An example of the former is current number of users and an example of the latter is number of server page requests.

The available counter values are:

BSI_4K_PAGES
The number of 4 K pages available in the system.
BSI_32K_PAGES
The number of 32 K pages available in the system.
BSI_128K_PAGES
The number of 128 K pages available in the system.
BSI_PAGES_USED
The total number of pages in use.
BSI_4K_PAGES_USED
The number of 4 K pages in use.
BSI_32K_PAGES_USED
The number of 32 K pages in use.
BSI_128K_PAGES_USED
The number of 128 K pages in use.

Parameters

 int32_t MimerGetStatistics (
             MimerSession sessionhandle,
             int32_t *counters,
             int16_t nr_of_counters)

sessionhandle
in
A session handle opened through a call to MimerBeginSession[C].
counters
inout

An array containing the counter values to retrieve.

On output, the array contains the corresponding counter values.

On return, a value of -2 indicates that the counter type was unknown, -1 indicate that the counter type was known but its value was not available.

nr_of_counters
in
Specifies the number of counters supplied in counters.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Mimer SQL Auto compatible.

MimerGetString

Gets character data from a result set or an output parameter.

Only the SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER and NATIONAL CHARACTER VARYING may be retrieved using this function.

Parameters

 int32_t MimerGetString (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             wchar_t *dest,
             size_t dest_maxlen)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
dest
out
A memory location where to place output wide character data. The character data is null terminated.
If this is a null pointer, no data will be returned, but the length is still returned by the routine.
dest_maxlen
in
The length of the dest memory location in characters.

Returns

A negative value indicating an error, or a zero or positive value indicating the number of characters in the column (not counting the terminating zero).

Return value
Description
>=0
Success.
The number of characters to be returned. (If > dest_maxlen, output data was truncated.)
MIMER_CAST_VIOLATION
If the output parameter or column was not of the CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING 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

Mimer SQL Auto compatible.

MimerGetStringC

Gets character data from a result set or an output parameter into a multi byte character string, where the character set is defined by the current locale.

Only the SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER and NATIONAL CHARACTER VARYING may be retrieved using this function.

Parameters

 int32_t MimerGetStringC (
             MimerStatement statementhandle,
             int16_t paramno_colno,
             char *dest,
             size_t dest_maxsiz)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.
paramno_colno
in
The parameter number or column number to get data from. First parameter/column is 1.
dest
out
A memory location where to place locale dependent character data. The character data is null terminated.
If this is a null pointer, no data will be returned, but the length is still returned by the routine.
dest_maxsiz
in
The length of the dest memory location in characters.

Returns

A negative value indicating an error, or a zero or positive value indicating the number of bytes in the column (not counting the terminating zero).

Return value
Description
>= 0
Success.
The number of characters to be returned. (If > dest_maxlen, output data was truncated.)
MIMER_CAST_VIOLATION
If the output parameter or column was not of the CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING 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

Mimer SQL Auto compatible.

MimerIsNull

Checks if a result set column or output parameter has the SQL null value.

Parameters

 int32_t MimerIsNull (
             MimerStatement statementhandle,
             int16_t paramno_colno)

statementhandle
in

A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.

paramno_colno
in
The parameter number or column number to check for null in. First column/parameter is 1.

Returns

If the column or parameter is the SQL null value, a positive value is returned. If it is not the SQL null value zero is returned. If an error occurred, a negative error code is returned.

Return value
Description
> 0
Null is returned.
0
Not null.
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.

Notes

Mimer SQL Auto compatible.

MimerNext

Advances the current row to the next row, but only within the current array.

If the end of the array is reached, end of data is returned, and a new request must be made to the server for additional rows.

The difference between calling this function and MimerFetch or MimerFetchSkip is that this routine is guaranteed to never make server requests and therefore guaranteed not to require any context switches.

Parameters

 int32_t MimerNext (MimerStatement statementhandle)

statementhandle
in

A handle returned by MimerBeginStatement[C], identifying a statement with an open cursor.

Returns

Returns MIMER_SUCCESS if the row was advanced one row. MIMER_NO_DATA was returned if the end of the array was reached.

Return value
Description
MIMER_NO_DATA
End of table reached.
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.

Notes

Not Mimer SQL Auto compatible.

MimerOpenCursor

Opens a cursor to be used when reading a result set.

Result sets are produced either by SELECT queries, or by calls to result set procedures.

All input parameters must be set prior to calling MimerOpenCursor, or else an error will occur.

If this routine returns successfully, the cursor is opened and positioned before the first row.

The first row can then be fetched by calling MimerFetch. After that column data may be retrieved using data output routines.

If the statement does not return a result set, this routine will return with a failure.

Parameters

 int32_t MimerOpenCursor (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a statement that have been executed.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
MIMER_SEQUENCE_ERROR
If the statement cursor is already open.
MIMER_UNSET_PARAMETER
All parameters has not yet been set.

Notes

Mimer SQL Auto compatible.

MimerParameterCount

Obtains the number of parameters of a statement.

Parameters

int32_t MimerParameterCount (MimerStatement statementhandle)

statementhandle
in

A handle returned by MimerBeginStatement[C], identifying the compiled statement which parameters to count.

Returns

If zero or positive, the number of parameters. If negative a standard Mimer error code.

Return value
Description
> = 0
Number of parameters.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
The statement is not compiled.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

Not Mimer SQL Auto compatible.

MimerParameterType

Obtains the data type of a parameter.

Parameters

 int32_t MimerParameterType(
             MimerStatement statementhandle,
             int16_t parameter) 

statementhandle
in

A handle returned by MimerBeginStatement[C], identifying the compiled statement which parameters to count.

parameter
in

The parameter number, where the leftmost parameter is 1.

Returns

Returns the parameter type or a negative value if an error occurred.

Return value
Description
> 0
Data type. See list in Data Types
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
Statement is not compiled.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The parameter number does not exist.

Notes

Not Mimer SQL Auto compatible.

MimerRowSize

Returns the maximum number of bytes required to hold one row of data. This routine might be used to calculate the maximum number of rows allowed in an array fetching scenario under certain memory restrictions.

For example, if it was determined that the fetching buffer must use no more than 20 000 bytes, although it would be desirable to use array fetching for performance reasons, calling this function would obtain a value to divide 20 000 with obtaining a reasonable maximum array set size.

Parameters

 int32_t MimerRowSize (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying the compiled statement which maximum row size to obtain.

Returns

If positive, the minimum number of bytes required to be guaranteed to hold one row of data. If negative, an error condition.

Return value
Description
>= 0
Number of bytes required to hold one row of data.
0 means that no input data
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
Statement is not compiled.

Notes

Not Mimer SQL Auto compatible.

MimerSetArraySize

Set the array size.

By default the MicroAPI routines MimerFetch and MimerFetchSkip uses an internal fetch buffer equal to the maximum size of one row. Depending on the actual size of the data, this buffer may hold more than one row. By increasing the array size, more data is retrieved in each server request.

Parameters

 int32_t MimerSetArraySize (
             MimerStatement statementhandle,
             int32_t arraysize)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying the compiled statement which array size to change.
arraysize
in
The number of rows to retrieve in each request.

Returns

MIMER_SUCCESS if successful. A negative value indicate an error.

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_SEQUENCE_ERROR
Statement is not compiled.

Notes

Not Mimer SQL Auto compatible.

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], 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_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 Mimer SQL Auto compatible.

MimerSetBlobData

Sets the data of a binary large object.

Whenever a binary large object has been created using a call to MimerSetLob, it has to be filled with data. This is done using a call to this routine. A call to this routine must always be preceded by a call to MimerSetLob.

The total length of all the chunks supplied by one or more calls to this routine must coincide with the length supplied in the preceding call to MimerSetLob, or else an error will occur.

When the entire binary large object has been set, the handle is automatically released.

Parameters

 int32_t MimerSetBlobData (
             MimerLob *blobhandle,
             const void *data,
             size_t size)

blobhandle
in
A reference to a binary large object handle created by MimerSetLob.
data
in
A pointer to the binary large object data.
size
in
Size of the chunk supplied in this call, in bytes.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The blobhandle parameter was not recognized as a handle.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerSetBoolean

Sets a boolean data parameter.

Only the database type BOOLEAN may be set using this call.

Parameters

 int32_t MimerSetBoolean (
             MimerStatement statementhandle,
             int16_t param_no,
             int32_t value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
A BOOLEAN value.
0 = false
1 = true

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 BOOLEAN.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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.

Notes

Mimer SQL Auto compatible.

MimerSetDouble

Sets a double precision floating point parameter.

Only the SQL datatypes REAL and DOUBLE PRECISION 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 MimerSetDouble (
             MimerStatement statementhandle,
             int16_t param_no,
             double value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in

A double precision floating point value.

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 FLOAT, REAL or DOUBLE PRECISION.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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_UNDEFINED_FLOAT_VALUE
The supplied double was either a not-a-number or infinity.

Notes

Mimer SQL Auto compatible.

MimerSetFloat

Sets a single precision floating point parameter.

Only the SQL datatypes REAL and DOUBLE PRECISION 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 MimerSetFloat (
             MimerStatement statementhandle,
             int16_t param_no,
             float value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in

A single precision floating point value.

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 REAL or DOUBLE PRECISION.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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_UNDEFINED_FLOAT_VALUE
The supplied double was either a not-a-number or infinity.

Notes

Mimer SQL Auto compatible.

MimerSetInt32

Sets an integer parameter.

Only the SQL data types INTEGER, BIGINT and SMALLINT 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 MimerSetInt32 (
             MimerStatement statementhandle,
             int16_t param_no,
             int32_t value)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in

An integer value.

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 an INTEGER, BIGINT or SMALLINT parameter.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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.

Notes

Mimer SQL Auto compatible.

MimerSetInt64

Sets an int64_t (long long) parameter.

Only the SQL data types INTEGER, BIGINT and SMALLINT 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 MimerSetInt64 (
             MimerStatement statementhandle,
             int16_t param_no,
             int64_t value)

statementhandle
in
A handle returned by MimerBeginStatement[C] identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
An integer value.
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 an integer parameter.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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.

Notes

Mimer SQL Auto compatible.

MimerSetLob

Sets a large object in the database.

This routine is used to create a large object (BINARY LARGE OBJECT, a CHARACTER LARGE OBJECT, or a NATIONAL CHARACTER LARGE OBJECT) in the database.

Whenever a large object is about to the inserted in the database as a parameter to a statement, this routine is called for that specific parameter.

Upon successful return, a handle to a large object is stored in the database. The contents of the object may be set at a later time using one or more calls to MimerSetBlobData or MimerSetNclobData.

If the size/length of the object is 0, MimerSetBlobData or MimerSetNclobData need not be called. If the size is larger than 0, MimerSetBlobData or MimerSetNclobData must be called to complete the creation of the large object.

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

Parameters

 int32_t MimerSetLob (
             MimerStatement statementhandle,
             int16_t param_no,
             size_t size_length,
             MimerLob *lobhandle)

statementhandle
in
A handle returned by MimerBeginStatement[C], identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
size_length
in
The size of the BINARY LARGE OBJECT in bytes, or the length of CHARACTER LARGE OBJECT or NATIONAL CHARACTER LARGE OBJECT in characters.
lobhandle
out
The handle to the created large object. If the object was of size 0, a handle is not created. This condition may be detected by comparing with the symbol MIMERNULLHANDLE.

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 a BINARY LARGE OBJECT, a CHARACTER LARGE OBJECT or a NATIONAL CHARACTER LARGE OBJECT.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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.

Notes

Mimer SQL Auto compatible.

MimerSetNclobData

Sets the data of a character large object.

Whenever a character large object has been created using a call to MimerSetLob, it has to be filled with data. This is done using a call to this routine. A call to this routine must always be preceded by a call to MimerSetLob.

When the entire character large object has been set, the handle is automatically released.

Parameters

 int32_t MimerSetNclobData (
             MimerLob *clobhandle,
             const wchar_t *data,
             size_t size)

clobhandle
in
A reference to a character large object handle created by MimerSetLob.
data
in
A pointer to the character data.
size
in
Length of the chunk supplied in this call, in bytes.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The clobhandle parameter was not recognized as a handle.
MIMER_ILLEGAL_CHARACTER
The input string contained illegal characters.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerSetNclobDataC

Sets the data of a character large object using a multibyte character pointer.

Whenever a character large object has been created using a call to MimerSetLob, it has to be filled with data. This is done using a call to this routine. A call to this routine must always be preceded by a call to MimerSetLob.

When the entire character large object has been set, the handle is automatically released.

Parameters

 int32_t MimerSetNclobDataC (
             MimerLob *clobhandle,
             const char *data,
             size_t length)

clobhandle
in
A reference to a character large object handle created by MimerSetLob.
data
in
A pointer to the character data.
length
in
Length of the chunk supplied in this call, in characters.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

Not Mimer SQL Auto compatible.

MimerSetNull

Sets an input parameter to the SQL null value.

Parameters

 int32_t MimerSetNull (
             MimerStatement statementhandle,
             int16_t paramno)

statementhandle
in
A handle returned by MimerBeginStatement[C] identifying a prepared statement.
paramno
in
The number of the parameter to set to null. First column/parameter is 1.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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.

Notes

Mimer SQL Auto compatible.

MimerSetString

Sets a string parameter.

This call sets a string parameter of a statement call. Only the SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER and NATIONAL CHARACTER VARYING may be set using this call.

Parameters

 int32_t MimerSetString (
             MimerStatement statementhandle,
             int16_t param_no,
             const wchar_t *value)

statementhandle
in
A handle returned by MimerBeginStatement[C] identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
A pointer to a buffer holding a null terminated character string. If this pointer is a null pointer, the parameter is set to the SQL null value.

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 a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or a NATIONAL CHARACTER VARYING.
MIMER_ILLEGAL_CHARACTER
If the input string contained illegal Unicode characters.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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 string was longer than could be held in the parameter.

Notes

Mimer SQL Auto compatible.

MimerSetStringC

Sets a string parameter using a multibyte character pointer.

Only the SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER and NATIONAL CHARACTER VARYING may be set using this call.

Parameters

 int32_t MimerSetStringC (
             MimerStatement statementhandle,
             int16_t param_no,
             const char *value)

statementhandle
in
A handle returned by MimerBeginStatement[C] identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
A pointer to a buffer holding a null terminated character string. If this pointer is a null pointer, the parameter is set to the SQL null value.

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 a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or a NATIONAL CHARACTER VARYING.
MIMER_ILLEGAL_CHARACTER
If the input string contained illegal characters.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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 string was longer than could be held in the parameter.

Notes

Mimer SQL Auto compatible.

MimerSetStringLen

Sets a string parameter.

This call sets a string parameter of a statement call. Only the SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER and NATIONAL CHARACTER VARYING may be set using this call.

Parameters

 int32_t MimerSetStringLen (
             MimerStatement statementhandle,
             int16_t param_no,
             const wchar_t *value,
             size_t length)

statementhandle
in
A handle returned by MimerBeginStatement[C] identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
A pointer to a buffer holding a null terminated wide character string. If this pointer is a null pointer, the parameter is set to the SQL null value.
length
in
Length of value.

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 a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or a NATIONAL CHARACTER VARYING.
MIMER_ILLEGAL_CHARACTER
If the input string contained illegal characters.
MIMER_HANDLE_INVALID
The statementhandle parameter was not recognized as a handle.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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 string was longer than could be held in the parameter.

Notes

Not Mimer SQL Auto compatible.

MimerSetStringLenC

Sets a string parameter using a multibyte character pointer.

Only the SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER and NATIONAL CHARACTER VARYING may be set using this call.

Parameters

 int32_t MimerSetStringLenC (
             MimerStatement statementhandle,
             int16_t param_no,
             const char *value,
             size_t length)

statementhandle
in
A handle returned by MimerBeginStatement[C] identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
A pointer to a buffer holding a null terminated character string. If this pointer is a null pointer, the parameter is set to the SQL null value.
length
in
Length of value.

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 a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or a NATIONAL CHARACTER VARYING.
MIMER_ILLEGAL_CHARACTER
If the input string contained illegal Unicode characters.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The referenced parameter does not exist.
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 string was longer than could be held in the parameter.

Notes

Not Mimer SQL Auto compatible.


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX