The SQL BITVARYING data type stores variable-length byte data that is potentially larger than 255 bytes. The BITVARYING data type is a predefined opaque type (an opaque data type that Informix defines). The DataBlade API supports the BITVARYING data type with the mi_bitvarying data type, which the DataBlade API implements as a varying-length structure.
For a BITVARYING column, the maximum size of the data is two kilobytes. This limitation is not inherent to the BITVARYING data type; however, the maximum row size in a database table is 32 kilobytes. If a BITVARYING column were to use the full supported size of 32 kilobytes, the table could contain only one column: a single BITVARYING column.
You can use an mi_bitvarying varying-length structure to store large amounts of byte data. For more information, see Varying-Length Data Type Structures.
The routine manager uses an mi_bitvarying structure to hold data for an argument or return value of a C UDR when this data is a varying-length opaque type. For more information, see Determining the Passing Mechanism for an Opaque Type.
You must use the mi_bitvarying data type if your UDR expects any varying-length data type as an argument or a return value. Within an MI_DATUM structure, the routine manager passes varying-length opaque-type data to and from a C UDR as a pointer to an mi_bitvarying varying-length structure. Therefore, a C UDR must handle this data as mi_bitvarying values when it receives arguments or returns data of a varying-length opaque data type, as the following table describes.
Handling Character Data | More Information |
---|---|
If the C UDR receives an argument of a varying-length opaque data type, it must declare its corresponding parameter as a pointer to an mi_bitvarying data type. | Handling Varying-Length Opaque-Type Arguments |
If a C UDR returns a value of a varying-length opaque data type, it must return a pointer to an mi_bitvarying data type. | Returning Opaque-Type Values |