To ensure portability of your C UDR, include the following items in the design and implementation of your C UDR:
The DataBlade API provides platform-independent data types, such as mi_smallint (two-byte integer), mi_integer (four-byte integer), and mi_double_precision (floating-point values). For a complete list of DataBlade API data types, see Table 4. The mitypes.h header file defines these data types.
To ensure maximum portability of your code, use these platform-independent data types instead of their C-language equivalents.
The DataBlade API provides special functions to handle the following data conversions that a C UDR might need to perform:
The control mode of a query determines whether the query results are in text or binary representation. The DataBlade API provides functions that convert between these two representations. Conversion between these two representations might also be useful in the input and output support functions of an opaque type. For a list of these functions, see Conversion of Opaque-Type Data Between Text and Binary Representations.
When opaque-type data is transferred between a client application and the database server, the database server calls the send and receive support functions. For these UDRs, you can handle potential differences in computer architecture that might affect the byte ordering or size with special DataBlade API functions. For more information, see Conversion of Opaque-Type Data with Computer-Specific Data Types.