Home | Previous Page | Next Page   Writing Support Functions >

Handling the Internal Representation

If a client application that uses an opaque data type executes on a different computer than the database server, the computers involved might have different ways of representing the internal structure of the opaque type. For example, the client computer might use a different byte ordering than the database server computer.

You must supply send and receive support functions, sometimes called transport functions, that convert data between the client application and the database server, commonly called receive and send functions.

You can choose arbitrary names for these support functions. The cast functions that use the functions identify the support functions to the database server.

The receive and send functions support the transfer of opaque types:

The send and receive functions should be reciprocal functions; that is, the receive function should produce a value that the send function accepts as an argument and the send function should produce a value that the receive function accepts as an argument.

The functions must handle conversions for all platform variations that the client application or external database server might encounter. When the local database server accepts a client connection or connects to a remote database server, it receives a description of the internal representations that the client or the remote database server uses. The database server uses this description to determine which data representation to use in its receive and send support functions.

The IBM Informix DataBlade API provides functions that support conversion between different internal representations of opaque types. The send and receive functions can call DataBlade API routines for each member of the internal structure to convert them to the appropriate representation for the destination platform.

Global Language Support

For an opaque data type to accept an internal representation on nondefault locales, you must use the IBM Informix GLS API in the receive and send functions to access Informix locales from within these functions. For more information, see Handling Locale-Sensitive Data (GLS).

End of Global Language Support
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]