Receive support function

The receive support function converts opaque data from its external binary representation on the client computer to its internal representation on the database server computer and provides an implicit cast from the SENDRECV to the opaque data type.

The database server calls the receive function when it receives the external binary representation of an opaque type from a client application. For example, when a client application issues an INSERT or UPDATE statement, it can send the external binary representation of an opaque type to the database server to be stored in a column.

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

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

The database server calls the receive function to convert the external binary representation of the client computer to the internal representation of the database server computer, where the opaque type is stored on disk.

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

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