Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


API Specification


The following routines are included in the Micro API:

Starts a session with the database. (wchar_t version.)
Starts a session with the database. (char version.)
Prepares a statement for execution. (wchar_t version.)
Prepares a statement for execution. (char version.)
Starts a transaction.
Closes an open cursor.
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.
Closes a prepared statement.
Commits or rollbacks a transaction.
Executes a statement that does not return a result set.
Executes a statement directly without parameters. (wchar_t version.)
Executes a statement directly without parameters. (char version.)
Advances to the next row of the result set.
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.
Gets binary data from a result set or an output parameter.
Retrieves the content of a binary large object.
Gets boolean data from a result set or an output parameter.
Gets double precision float data from a result set or an output parameter.
Gets integer data from a result set or an output parameter.
Obtains a large object handle.
Gets long integer data from a result set or an output parameter.
Retrieves the contents of a character large object. (wchar_t version.)
Retrieves the contents of a character large object. (char version.)
Gets character data from a result set or an output parameter. (wchar_t version.)
Gets character data from a result set or an output parameter into a multi byte character string. (char version.)
Checks if a result set column or output parameter has the SQL NULL value.
Advances the current row to the next row, within the current array.
Opens a result set.
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.
Sets the data of a binary large object.
Sets a boolean data parameter.
Sets a double floating point parameter.
Sets an integer parameter.
Sets a large object in the database.
Sets a long long integer parameter.
Sets the data of a character large object. (wchar_t version.)
Sets the data of a character large object. (char version.)
Sets an input parameter to the SQL NULL value.
Sets a string parameter. (wchar_t version.)
Sets a string parameter. (char version.)
Sets a string parameter. (wchar_t version.)
Sets a string parameter. (char version.)

MimerBeginSession

Starts a session with the database.

Parameters

 int 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 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
A session handle identifying the session in future calls to MimerEndSession, MimerBeginStatement, MimerBeginTransaction, and MimerEndTransaction.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
< 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

MimerBeginSessionC

Starts a session with the database.

Parameters

 int 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 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
A session handle identifying the session in future calls to MimerEndSession, MimerBeginStatement, MimerBeginTransaction, and MimerEndTransaction.

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
< 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

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

 int MimerBeginStatement (
   MimerSession sessionhandle,
   const wchar_t *sqlstatement,
   short options,
   MimerStatement *statementhandle)

sessionhandle
in
A handle returned by MimerBeginSession, identifying the session.
sqlstatement
in
SQL statement string.
options
in
A bit mask of options identifying the characteristics of the statement.
MIMER_FORWARD_ONLY (0x0)
MIMER_SCROLLABLE (0x1)
Specifies a cursor being scrollable, or forward only.
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 Unicode character.
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_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.

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

 int MimerBeginStatementC (
   MimerSession sessionhandle,
   const char *statementname,
   short options,
   MimerStatement *statementhandle)

sessionhandle
in
A handle returned by MimerBeginSession identifying the session.
sqlstatement
in
SQL statement string.
options
in
A bit mask of options identifying the characteristics of the statement.
MIMER_FORWARD_ONLY (0x0)
MIMER_SCROLLABLE (0x1)
Specifies a cursor being scrollable, or forward only.
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 Unicode character.
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_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.

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. See Transactions.)

Parameters

 int MimerBeginTransaction (
   MimerSession sessionhandle,
   short transoption)

sessionhandle
in
A handle returned by MimerBeginSession, identifying the session.
transoption
in
A bit mask of options identifying the characteristics of the transaction.
MIMER_TRANS_READWRITE (0x0)
MIMER_TRANS_READONLY (0x1)
Specifies a transaction being read/write, or read only.
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_OUTOFMEMORY
If not enough memory could be allocated.
Other value < 0
Any of the server error codes listed in Return Codes.

Note: This routine interacts with the database server.

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

 int MimerCloseCursor (
   MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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.

MimerColumnCount

Obtains the number of columns in a result set.

Parameters

 int MimerColumnCount (
   MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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.
< 0
Any of the server error codes listed in Return Codes.

MimerColumnName

Obtains the name of a column.

Parameters

 int MimerColumnName (
   MimerStatement statement,
   int column,
   wchar_t *columnname,
   size_t maxlen)

statementhandle
in
A handle returned by MimerBeginStatement, 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_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.

MimerColumnNameC

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

Parameters

 int MimerColumnNameC (
   MimerStatement statement,
   int column,
   char *columnname,
   size_t maxlen)

statementhandle
in
A handle returned by MimerBeginStatement 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 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_SEQUENCE_ERROR
Statement is not compiled.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The column number does not exist.
-24241
The column name contained characters which could not be represented in the current locale.
Other value < 0
Any of the server error codes listed in Return Codes.

MimerColumnType

Returns the type of a column.

Parameters

 int MimerColumnType (
   MimerStatement statementhandle,
   int column)

statementhandle
in
A handle returned by MimerBeginStatement, 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_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.

MimerCurrentRow

Returns the current row of a result set.

Parameters

 int MimerCurrentRow (
   MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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_SEQUENCE_ERROR
If the statement cursor is not open.

MimerEndSession

Ends a database session.

If there are any active transactions, these are rollbacked.

Parameters

 int MimerEndSession (
   MimerSession *sessionhandle)

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

Returns

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

Return value
Description
MIMER_SUCCESS
Success.
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.

MimerEndStatement

Closes a prepared statement.

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

Parameters

 int MimerEndStatement (
   MimerStatement *statementhandle)

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

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.

MimerEndTransaction

Commits or rollbacks a transaction.

Open cursors are automatically closed.

Parameters

 int MimerEndTransaction (
   MimerSession sessionhandle,
   short commit_rollback)

sessionhandle
in
A handle returned by MimerBeginSession 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.
< 0
Any of the server error codes listed in Return Codes.

Notes

This routine interacts with the database server.

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

 int MimerExecute (
   MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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.

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

 int MimerExecuteStatement (
   MimerSession sessionhandle,
   const wchar_t *sqlstatement)

sessionhandle
in
A handle returned by MimerBeginSession, 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 Unicode character.
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.

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

 int MimerExecuteStatementC (
   MimerSession sessionhandle,
   const char *sqlstatement)

sessionhandle
in
A handle returned by MimerBeginSession, 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 Unicode character.
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.

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

 int MimerFetch (
   MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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_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.

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

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

statementhandle
in
A handle returned by MimerBeginStatement, identifying a statement with an open cursor.
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_SEQUENCE_ERROR
If there is no open result set on this statement.
###
If the cursor was not scrollable.
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.

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

 int MimerFetchSkip (
   MimerStatement statementhandle,
   int count)

statementhandle
in
A handle returned by MimerBeginStatement, 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_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.

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

 int MimerGetBinary (
   MimerStatement statementhandle,
   short paramno_colno,
   void *dest,
   size_t dest_maxsiz)

statementhandle
in
A handle returned by MimerBeginStatement, 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 length of the available 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_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.)

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

 int 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_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.

MimerGetBoolean

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

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

Parameters

 int MimerGetBoolean (MimerStatement statementhandle, short 
paramno_colno, int *value)

statementhandle
in
A handle returned by MimerBeginStatement, 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 BOOLEAN data type.
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.)

MimerGetDouble

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

Only the database data types DOUBLE PRECISION, FLOAT(n), FLOAT and REAL may be retrieved using this call.

Parameters

 int MimerGetDouble (
   MimerStatement statementhandle,
   short paramno_colno,
   double *value)

statementhandle
in
A handle returned by MimerBeginStatement, 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 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, FLOAT(n), FLOAT or REAL data type.
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.)

MimerGetInteger

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

Only the database data types INTEGER, INTEGER(n), BIGINT and SMALLINT may be get using this call.

Parameters

 int MimerGetInteger (MimerStatement statementhandle, short 
paramno_colno, int *value)

statementhandle
in
A handle returned by MimerBeginStatement, 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, INTEGER(n), BIGINT or SMALLINT data types.
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.)

MimerGetLob

Obtains a large object handle.

Only the database 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

 int MimerGetLob (MimerStatement statementhandle, short colno, 
size_t *size_length, MimerLob *lobhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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_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.)

MimerGetLongLong

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

Only the database data types INTEGER, INTEGER(n), BIGINT and SMALLINT may be retrieved using this call.

Parameters

 int MimerGetLongLong (MimerStatement statementhandle, short 
paramno_colno, long long *value)

 
statementhandle
in
A handle returned by MimerBeginStatement, 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, INTEGER(n), BIGINT or SMALLINT data types.
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.)

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

 int MimerGetNclobData (MimerLob *clobhandle, wchar_t *data, size_t 
length)
 
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 length to retrieve in characters, including terminating zero. 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_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.

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

 int 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_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.

MimerGetString

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

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

Parameters

 int MimerGetString (MimerStatement statementhandle, short 
paramno_colno, wchar_t *dest, size_t dest_maxlen)

statementhandle
in
A handle returned by MimerBeginStatement, 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 UTF-16 or UTF-32 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 size 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_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.)

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 SQL data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER, and NATIONAL CHARACTER VARYING may be retrieved using this function.

Parameters

 int MimerGetStringC (MimerStatement statementhandle, short 
paramno_colno, char *dest, size_t dest_maxlen)

statementhandle
in
A handle returned by MimerBeginStatement, 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_maxlen
in
The size 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_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.)

MimerIsNull

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

Parameters

 int MimerIsNull (MimerStatement statementhandle, short 
paramno_colno)

statementhandle
in

A handle returned by MimerBeginStatement, 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_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.

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

 int MimerNext (MimerStatement statementhandle)

statementhandle
in

A handle returned by MimerBeginStatement, 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.

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

 int MimerOpenCursor (MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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_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.

MimerParameterCount

Obtains the number of parameters of a statement.

Parameters

 int MimerParameterCount (MimerStatement statementhandle)

statementhandle
in

A handle returned by MimerBeginStatement, 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.
< 0
Any of the server error codes listed in Return Codes.

MimerParameterType

Obtains the data type of a parameter.

Parameters

 int MimerParameterType(
   MimerStatement statementhandle,
   int parameter) 

statementhandle
in

A handle returned by MimerBeginStatement, 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_SEQUENCE_ERROR
Statement is not compiled.
MIMER_NONEXISTENT_COLUMN_PARAMETER
The parameter number does not exist.

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

 int MimerRowSize (
   MimerStatement statementhandle)

statementhandle
in
A handle returned by MimerBeginStatement, 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_SEQUENCE_ERROR
Statement is not compiled.

MimerSetArraySize

By default the Micro API routines MimerFetch and MimerFetchSkip fetches one row at a time from the server. This routine sets the maximum number of rows to retrieve in each server request.

Parameters

 int MimerSetArraySize (
   MimerStatement statementhandle,
   int arraysize)

statementhandle
in
A handle returned by MimerBeginStatement, identifying the compiled statement which array size to change.
arraysize
in
The maximum 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_SEQUENCE_ERROR
Statement is not compiled.

MimerSetBinary

Sets a binary data parameter.

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

If the statement handle has no buffer memory attached to it, through a previous call to a data input routine, sufficient memory is allocated by this call. This memory is kept until the statement is closed, when the statement is executed if the statement did not have any output parameters or any result set columns, or an existing result set is closed.

Parameters

 int MimerSetBinary (
   MimerStatement statementhandle,
   short param_no,
   const void *value, 
   size_t size)

statementhandle
in
A handle returned by MimerBeginStatement, 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.
size
in
The length 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_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.

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

 int MimerSetBlobData (
   MimerLob *blobhandle,
   const void *data,
   size_t length)

blobhandle
in
A reference to a binary large object handle created by MimerSetLob.
data
in
A pointer to the binary large object data.
length
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_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.

MimerSetBoolean

Sets a boolean data parameter.

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

Parameters

 int MimerSetBoolean (
   MimerStatement statementhandle,
   short param_no,
   int value)

statementhandle
in
A handle returned by MimerBeginStatement, identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
value
in
A BOOLEAN 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 BOOLEAN.
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.

MimerSetDouble

Sets a double floating point parameter.

If the statement handle has no buffer memory attached to it, through a previous call to a data input routine, sufficient memory is allocated by this call. This memory is kept until the statement is closed, when the statement is executed if the statement did not have any output parameters or any result set columns, or an existing result set is closed.

Parameters

 int MimerSetDouble (
   MimerStatement statementhandle,
   short param_no,
   double value)

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

A double 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_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.

MimerSetInteger

Sets an integer parameter.

Only the database data types INTEGER, INTEGER(n), BIGINT and SMALLINT may be set using this call.

If the statement handle has no buffer memory attached to it, through a previous call to a data input routine, sufficient memory is allocated by this call. This memory is kept until the statement is closed, when the statement is executed if the statement did not have any output parameters or any result set columns, or an existing result set is closed.

Parameters

 int MimerSetInteger (
   MimerStatement statementhandle,
   short param_no,
   int value)

statementhandle
in
A handle returned by MimerBeginStatement, 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, INTEGER(n), BIGINT or SMALLINT parameter.
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.

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

 int MimerSetLob (
   MimerStatement statementhandle,
   short param_no,
   size_t size_length,
   MimerLob *lobhandle)

statementhandle
in
A handle returned by MimerBeginStatement, identifying a prepared statement.
param_no
in
A number identifying the parameter. First parameter is 1.
size_length
in
If the parameter is a BINARY LARGE OBJECT this indicates the size in bytes. If the parameter is a CHARACTER LARGE OBJECT or NATIONAL CHARACTER LARGE OBJECT, then this is the length 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_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.

MimerSetLongLong

Sets a long long integer parameter.

If the statement handle has no buffer memory attached to it, through a previous call to a data input routine, sufficient memory is allocated by this call. This memory is kept until the statement is closed, when the statement is executed if the statement did not have any output parameters or any result set columns, or an existing result set is closed.

Parameters

 int MimerSetLongLong (
   MimerStatement statementhandle,
   short param_no,
   long long value)

statementhandle
in
A handle returned by MimerBeginStatement 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_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.

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

 int MimerSetNclobData (
   MimerLob *clobhandle,
   const wchar_t *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.

MimerSetNclobDataC

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

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

MimerSetNull

Sets an input parameter to the SQL NULL value.

Parameters

 int MimerSetNull (
   MimerStatement statementhandle,
   short paramno)

statementhandle
in
A handle returned by MimerBeginStatement 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_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.

MimerSetString

Sets a string parameter.

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

Caution: If this routine is called on a CHARACTER or CHARACTER VARYING column, and the supplied string contains characters not within the ISO 8859-1 character encoding, these characters are replaced with a question mark (?).

Parameters

 int MimerSetString (
   MimerStatement statementhandle,
   short param_no,
   const wchar_t *value)

statementhandle
in
A handle returned by MimerBeginStatement 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 UTF-16 or UTF-32 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.

MimerSetStringC

Sets a string parameter. Only the database data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER, and NATIONAL CHARACTER VARYING may be set using this call.

Caution: If this routine is called on a CHARACTER or CHARACTER VARYING column, and the supplied string contains characters not within the ISO 8859-1 character encoding, these characters are replaced with a question mark (?).

Parameters

 int MimerSetStringC (
   MimerStatement statementhandle,
   short param_no,
   const char *value)

statementhandle
in
A handle returned by MimerBeginStatement 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.

MimerSetStringLen

Sets a string parameter.

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

Caution: If this routine is called on a CHARACTER or CHARACTER VARYING column, and the supplied string contains characters not within the ISO 8859-1 character encoding, these characters are replaced with a question mark (?).

Parameters

 int MimerSetStringLen (
   MimerStatement statementhandle,
   short param_no,
   const wchar_t *value,
   size_t ###)

statementhandle
in
A handle returned by MimerBeginStatement 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 UTF-16 or UTF-32 character string. If this pointer is a NULL pointer, the parameter is set to the SQL NULL value.
###
in
###

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.

MimerSetStringLenC

Sets a string parameter. Only the database data types CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER, and NATIONAL CHARACTER VARYING may be set using this call.

Caution: If this routine is called on a CHARACTER or CHARACTER VARYING column, and the supplied string contains characters not within the ISO 8859-1 character encoding, these characters are replaced with a question mark (?).

Parameters

 int MimerSetStringLenC (
   MimerStatement statementhandle,
   short param_no,
   const char *value,
   size_t ###)

statementhandle
in
A handle returned by MimerBeginStatement 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.
###
in
###

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.


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