Control modes for query data

The data that the database server returns for a query can be in one of two control modes:
  • In text representation, the query data is represented as null-terminated strings. Data in its text representation is often called a literal value.
  • In binary representation, the query data is represented in its internal format; that is, in the format that the database server uses to store the value.
The following table shows the format of different data types in the two control modes.
Table 1. Control modes for data
Type of data Text representation Binary representation
Character Null-terminated string Varying-length structure: mi_lvarchar
Date mm/dd/yyyy

Nondefault locale: End-user date format

Integer number of days since December 31, 1899

(DATE, mi_date)

Date/time yyyy-mm-dd HH:MM:SS

Nondefault locale: End-user date and time format

dtime_t

(DATETIME, mi_datetime)

Interval yyyy-mm

dd HH:MM:SS

Nondefault locale: End-user date and time format

intrvl_t

(INTERVAL, mi_interval)

Integer Integer value as a string:

thousands separator = ","

Nondefault locale: End-user numeric format

Internal format:
  • Two-byte integer (SMALLINT, mi_smallint)
  • Four-byte integer (INTEGER, mi_integer)
  • Eight-byte integer: ifx_int8_t (INT8, mi_int8)
Decimal Fixed-point value as a string:

thousands separator = ","

decimal separator = "."

Nondefault locale: End-user numeric format

dec_t

(DECIMAL, mi_decimal)

Monetary Fixed-point value as a string:

thousands separator = ","

decimal separator = "."

currency symbol = "$"

Nondefault locale: End-user monetary format

dec_t

(MONEY, mi_money)

Floating-point Floating-point value as a string:

thousands separator = ","

decimal separator = "."

Nondefault locale: End-user numeric format

Internal format:
  • single-precision floating point (SMALLFLOAT, mi_real)
  • double-precision floating point (FLOAT, mi_double_precision)
Boolean "t" or "T"

"f" or "F"

MI_TRUE, MI_FALSE

(BOOLEAN, mi_boolean)

Smart large object Text representation of the LO handle (obtained with mi_lo_to_string()) LO handle

(CLOB, BLOB; MI_LO_HANDLE)

Row type Unnamed row type:

"ROW(fld_value1, fld_value2, ...)"

Named row type:

"row_type(fld_value1, fld_value2, ...)"
Row structure

(ROW, named row type; MI_ROW)

Collection type "SET{elmnt_value, elmnt_value, ...}"

"MULTISET{elmnt_value, elmnt_value, ...}"

"LIST{elmnt_value, elmnt_value, ...}"

Collection structure

(SET, LIST, MULTISET; MI_COLLECTION)

Varying-length opaque type External format of opaque type (as returned by output support function) Varying-length structure: mi_bitvarying (which contains the internal C data type)
Fixed-length opaque type External format of opaque type (as returned by output support function) Internal C data type
Distinct type Text representation of its source data type Binary representation of its source data type
The mi_exec() function indicates the control mode of the query with a bit-mask control argument, which is one of the following flags.
Control mode Control-flag value
Text representation MI_QUERY_NORMAL
Binary representation MI_QUERY_BINARY

In the send_statement() function, mi_exec() sets the control mode of the query data to text representation.

To determine the control mode for query data, use the mi_binary_query() function. The mi_binary_query() function determines the control mode for data of the current statement.