The ITDatum interface

Base class: ITValue

Provides access to the underlying data of a database class. It allows you to retrieve or set underlying data and determine their lengths. In addition, you can access the connection of the value object to the server.

All database classes that want to provide access to their underlying data expose this interface.

For some kinds of data (for example, row, collection, smartblob handle, character data) MI_DATUM is a pointer to the descriptor (MI_ROW *, MI_COLLECTION *, MI_LO_HANDLE *, MI_LVARCHAR *) rather than to the memory containing the data values. For these kinds of data ITDatum::Data returns a pointer to the descriptor. Pass a descriptor of the appropriate kind to SetData(). In addition, some of these descriptors are opaque (for example, MI_ROW). In these cases, the DataLength() return value is not usable and the data length SetData() argument is ignored.

This class provides the following methods.
Method Description
MI_DATUM Data() Returns an MI_DATUM encapsulated by the value object. Datum passing (by reference/value) obeys the same rules as mi_value() (see the Informix® DataBlade® API Programmer's Guide for information about mi_value()). If the datum is returned by reference, its memory is managed by the object. The application cannot modify the datum returned by reference.
long DataLength() Returns the length of the datum encapsulated by the value object.
ITBool SetData (MI_DATUM data, long dataLen, ITPreserveData *preservedata = NULL) Sets the value of a datum encapsulated by the value object to the parameter value. It returns TRUE if the operation was successful, FALSE otherwise.
const ITConnection & Connection() Returns the connection of the value object.