Data Types

The C acronym for each SQL data type is listed in the below table.

Data type

SQL data type

MIMER_BINARY

BINARY

MIMER_BINARY_VARYING

BINARY VARYING

MIMER_BLOB

BINARY LARGE OBJECT

MIMER_BOOLEAN

BOOLEAN

MIMER_CHARACTER

CHARACTER

MIMER_CHARACTER_VARYING

CHARACTER VARYING

MIMER_CLOB

CHARACTER LARGE OBJECT

MIMER_DATE *

DATE

MIMER_DECIMAL *

DECIMAL

MIMER_FLOAT *

FLOAT(p)

MIMER_INTEGER

INTEGER(p)

MIMER_INTERVAL_DAY *

INTERVAL DAY

MIMER_INTERVAL_DAY_TO_HOUR *

INTERVAL DAY TO HOUR

MIMER_INTERVAL_DAY_TO_MINUTE *

INTERVAL DAY TO MINUTE

MIMER_INTERVAL_DAY_TO_SECOND *

INTERVAL DAY TO SECOND

MIMER_INTERVAL_HOUR *

INTERVAL HOUR

MIMER_INTERVAL_HOUR_TO_MINUTE *

INTERVAL HOUR TO MINUTE

MIMER_INTERVAL_HOUR_TO_SECOND *

INTERVAL HOUR TO SECOND

MIMER_INTERVAL_MINUTE *

INTERVAL MINUTE

MIMER_INTERVAL_MINUTE_TO_SECOND *

INTERVAL MINUTE TO SECOND

MIMER_INTERVAL_MONTH *

INTERVAL MONTH

MIMER_INTERVAL_SECOND *

INTERVAL SECOND

MIMER_INTERVAL_YEAR *

INTERVAL YEAR

MIMER_INTERVAL_YEAR_TO_MONTH *

INTERVAL YEAR TO MONTH

MIMER_NCHAR

NATIONAL CHARACTER

MIMER_NCHAR_VARYING

NATIONAL CHARACTER VARYING

MIMER_NCLOB

NATIONAL CHARACTER LARGE OBJECT

MIMER_T_BIGINT

BIGINT

MIMER_T_DOUBLE

DOUBLE PRECISION

MIMER_T_FLOAT

FLOAT

MIMER_T_INTEGER

INTEGER

MIMER_T_REAL

REAL

MIMER_T_SMALLINT

SMALLINT

MIMER_TIME *

TIME

MIMER_TIMESTAMP *

TIMESTAMP

The data types marked with an asterisk (*) are not supported by the Mimer API’s data input and data output routines. To use these data types, convert the data using the SQL function CAST.

The following table describes which API calls may be used to set or get parameters and column values of the corresponding SQL data type.

SQL data type

Routines

BIGINT

MimerGetInt64

MimerSetInt64

BINARY

MimerGetBinary

MimerSetBinary

BINARY LARGE OBJECT

MimerGetLob

MimerGetBlobData

MimerSetLob

MimerSetBlobData

BINARY VARYING

MimerGetBinary

MimerSetBinary

BOOLEAN

MimerGetBoolean

MimerSetBoolean

CHARACTER

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

CHARACTER LARGE OBJECT

MimerGetLob

MimerGetNclobData

MimerGetNclobData8

MimerGetNclobDataC

MimerSetLob

MimerSetNclobData

MimerSetNclobData8

MimerSetNclobDataC

CHARACTER VARYING

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

DATE

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

DECIMAL

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

DOUBLE PRECISION

MimerGetDouble

MimerSetDouble

INTEGER

MimerGetInt32

MimerGetInt64

MimerSetInt32

MimerSetInt64

NATIONAL CHARACTER

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

NATIONAL CHARACTER LARGE OBJECT

MimerGetLob

MimerGetNclobData

MimerGetNclobData8

MimerGetNclobDataC

MimerSetLob

MimerSetNclobData

MimerSetNclobData8

MimerSetNclobDataC

NATIONAL CHARACTER VARYING

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

NUMERIC

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

REAL

MimerGetDouble

MimerGetFloat

MimerSetDouble

MimerSetFloat

SMALLINT

MimerGetInt32

MimerGetInt64

MimerSetInt32

MimerSetInt64

TIME

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

TIMESTAMP

MimerGetString

MimerGetString8

MimerGetStringC

MimerSetString

MimerSetString8

MimerSetStringC

Data types which do not have a corresponding manipulation method according to the above table must be explicitly casted to a data type which does.

Detecting Data Types at Run-time

If the data type of a column or parameter is not known until runtime it is possible to detect them and dynamically choose which getter or setter function to use. For this purpose the functions MimerColumnType and MimerParameterType are used to obtain the type of a column or parameter.

 

A range of macros may be used to determine which getter/setter which matches the data type obtained from MimerColumnType or MimerParameterType. These are:

Macro

Description

MimerIsBinary(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetBinary or MimerSetBinary.

MimerIsBlob(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetBlobData or MimerSetBlobData.

MimerIsBoolean(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetBoolean or MimerSetBoolean.

MimerIsClob(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetNclobData[C|8] or MimerSetNclobData[C|8].

MimerIsDouble(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetDouble or MimerSetDouble.

MimerIsFloat(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetFloat or MimerSetFloat.

MimerIsInt32(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetInt32 or MimerSetInt32.

MimerIsInt64(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetInt64 or MimerSetInt64.

MimerIsString(t)

Will yield true if the type (t) can be accessed or manipulated using MimerGetString[C|8] or MimerSetString[C|8].