Send support function

The database server calls the send function when it sends the external binary representation of an opaque type to a client application. For example, when a client application issues a SELECT or FETCH statement, it can save the data of an opaque type that it receives from the database server in a host variable that conforms to the external binary representation of the opaque type.

The following figure shows when the database server executes the send support function.
Figure 1: Execution of the send support function

begin figure description - This figure is described in the surrounding text. - end figure description

The database server calls the send function to convert the internal representation that is stored on disk to the external binary representation that the client computer uses.

The send function takes as an argument the internal structure for the opaque type on the database server computer and returns an mi_sendrecv structure that holds the internal structure on the client computer. The following function signature is for a send support function of an opaque data type whose internal structure is ll_longlong_t:
mi_sendrecv * ll_longlong_send(ll_longlong_t *srvr_intrnl_format);

The ll_longlong_send() function is a cast function from the ll_longlong_t internal structure to the SENDRECV data type. It must be registered as an explicit cast function with the CREATE EXPLICIT CAST statement. For more information about cast functions, see Create casts for opaque data types.