Stream support functions
The following support functions convert a UDT to or from a stream
representation while reading the UDT from a stream or writing the
UDT to a stream.
- streamwrite()
- Conversion of opaque-type data from its binary representation to its stream representation
- streamread()
- Conversion of opaque-type data from its stream representation to its binary representation
The stream representation is self-contained and includes enough
information to enable the streamread() function
to recreate the UDT instance.
Important: If
the UDT includes out-of-row data, the stream representation normally
includes that data.
Enterprise Replication invokes the streamwrite() and streamread() support functions when replicating
UDT columns. The streams it passes to these functions are Enterprise Replication streams,
a write-only stream for streamwrite() and a
read-only stream for streamread(). You cannot
open or close an Enterprise Replication stream or use the mi_stream_setpos() or mi_stream_seek() function on it. For more information
about Enterprise Replication, see the HCL®
Informix® Enterprise Replication
Guide.
Important: If a column that includes out-of-row data is to be replicated,
avoid placing a NOT NULL constraint on the column. Enterprise Replication collects out-of-row
data for transmission after the user transaction has committed. Due
to activity on the replicated row, the data might not exist at the
time Enterprise Replication collects it for replication. In such cases, Enterprise Replication normally
applies a NULL on the target system.