Access attributes
The LO-specification structure uses a bitmask flag, called an attributes flag, to specify the attributes of a smart large object.
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. |
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. |
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.
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:
- If you need to set more than one attribute, use the C-language bitwise OR operator (|) to mask attribute constants together.
- 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.
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.