The input and output support functions

To handle opaque-type data in its external text representation, the database server calls the input and output support functions for the opaque type.

The external representation is the text version of the opaque-type data. (For more information, see Determine external representation.) The external representation is often what end users enter for the opaque-type value. When a client application sends or receives opaque-type data in its external representation, the database server must find a support function to handle the conversion of this data between its server internal representation (in the database) and the external representation. The input and output support functions are the cast functions for an opaque type between its external (text) representation and its internal (binary) representation (on the server computer). The server internal representation is the C structure that holds the opaque-type data in the database. For more information, see Determine internal representation.

The database server stores the external representation of an opaque type in an mi_lvarchar structure. The mi_lvarchar structure is a varying-length structure that encapsulates the external representation of the opaque type. The mi_lvarchar structure is always passed by reference. Therefore, the input and output support routines cast the data as follows.
Opaque-type support function Cast from Cast to
Input mi_lvarchar * Server internal representation of the opaque data type
Output Server internal representation of the opaque data type mi_lvarchar *

There is no limitation on the size of an mi_lvarchar structure. The DataBlade® API can transport mi_lvarchar data to and from the database server. However, to conform to the storage limit of a database table (32 KB for a table, 2 KB for an LVARCHAR column), the input support function might need to handle extra data and the output support function might need to generate the extra data.

The two-kilobyte restriction does not apply to an mi_lvarchar structure that holds the external representation of an opaque-type column. If the input and output support functions of the opaque data type can handle more than two kilobytes, the mi_lvarchar structure can hold more than two kilobytes. For more information, see The mi_lvarchar data type.

For your opaque data type to accept an external representation in non-default locales, you must internationalize the input and output support functions. For more information, see Internationalization of DataBlade API modules (GLS).