Access attributes

The LO-specification structure uses a bitmask flag, called an attributes flag, to specify the attributes of a smart large object.

The following tables show the attribute constants of an LO-specification structure.
Table 1. Logging attribute constants in the LO-specification structure
Logging attribute constant Description Considerations
MI_LO_ATTR_LOG Log changes to the smart large object in the system log file. Consider carefully whether to use the MI_LO_ATTR_LOG flag value. The database server incurs considerable overhead to log smart large objects. For more information, see Logging.
MI_LO_ATTR_NO_LOG Turn off logging for all operations that involve the associated smart large object.
Table 2. Last-access time attribute constants in the LO-specification structure
Last-access time attribute constant Description Considerations
MI_LO_ATTR_KEEP_LASTACCESS_TIME Save the last-access time for the smart large object. Consider carefully whether to use this flag value. The database server incurs considerable overhead in logging and concurrency to maintain last-access times for smart large objects. For more information, see Last-access time.
MI_LO_ATTR_NOKEEP_LASTACCESS_TIME Do not maintain the last-access time for the smart large object.
Table 3. Data-integrity time attribute constants in the LO-specification structure
Data-integrityattribute constant Description Considerations
MI_LO_ATTR_HIGH_INTEG Use both a page header and a page trailer for the pages of the sbspace. Consider carefully whether to use this flag value. Although moderate integrity takes less disk space per page, it also reduces the ability of the database server to recover information if disk errors occur. For more information, see Data integrity.
MI_LO_ATTR_MODERATE_INTEG Use only a page header for the pages of the sbspace.

The milo.h header file defines the attribute constants: MI_LO_ATTR_LOG, MI_LO_ATTR_NO_LOG, MI_LO_ATTR_KEEP_LASTACCESS_TIME, and MI_LO_ATTR_NOKEEP_LASTACCESS_TIME, MI_LO_ATTR_HIGH_INTEG, and MI_LO_ATTR_MODERATE_INTEG.

The following table shows the LO-specification accessor functions for the attribute information.
Table 4. Accessor functions for attribute information in the LO-specification structure
LO-specification accessor function Description
mi_lo_specget_flags() Overrides system-specified or column-level attributes in the LO-specification structure with the attributes that the attributes flag specifies
mi_lo_specset_flags() Retrieves the attributes flag from the LO-specification structure

To set an attributes flag:

  1. If you need to set more than one attribute, use the C-language bitwise OR operator (|) to mask attribute constants together.
  2. Use the mi_lo_specset_flags() accessor function to store the attributes flag in the LO-specification structure.

Masking mutually exclusive flags results in an error. If you do not specify a value for a particular attribute, the database server uses the storage-characteristics hierarchy to determine this information.

For example, the following code fragment specifies the constants to enable logging the last-access time for the attributes flag in the LO-specification structure that LO_spec identifies:
MI_CONNECTION *conn;
MI_LO_SPEC *LO_spec = NULL;
mi_integer create_flgs;
...

if ( mi_lo_spec_init(conn, &LO_spec) != MI_OK )
   /* handle error and exit */
create_flgs = 
   MI_LO_ATTR_LOG | MI_LO_ATTR_KEEP_LASTACCESS_TIME;
if ( mi_lo_specset_flags(LO_spec, create_flgs) != MI_OK )
   /* handle error and exit */

For more information about the attributes of a smart large object, see Attribute information and the descriptions of the mi_lo_specset_flags() and mi_lo_specget_flags() functions in the Informix® DataBlade® API Function Reference.