The SQL BOOLEAN data type holds the internal (binary) format of a Boolean value. This value is a single-byte representation of Boolean data, as the following table shows.
The BOOLEAN data type is a predefined opaque type (an opaque data type that Informix defines). Its external format is the Boolean text representation that Table 12 shows. Its internal format consists of the values that the preceding table shows. For a complete description of the SQL BOOLEAN data type, see the IBM Informix: Guide to SQL Reference.
The DataBlade API supports the SQL BOOLEAN data type with the mi_boolean data type. Therefore, the mi_boolean data type also holds the binary representation of a Boolean value.
An mi_boolean value is one byte on all computer architectures; therefore, it can fit into an MI_DATUM structure. You can pass mi_boolean data by value in C UDRs.
In client LIBMI applications, you must pass all data by reference, including mi_boolean values.
Because an mi_boolean value is smaller than the size of an MI_DATUM structure, the DataBlade API cast promotes the value to the size of MI_DATUM when you copy the value into an MI_DATUM structure. When you obtain the mi_boolean value from an MI_DATUM structure, you need to reverse the cast promotion to ensure that your value is correct.
MI_DATUM datum; mi_boolean bool_val; ... bool_val = (char) datum;
Alternatively, you can declare an mi_integer value to hold the Boolean value.