For most smart large objects, all you need to do is obtain
the system-specified storage characteristics. When you obtain these
storage characteristics for a smart large object, you can specify
a location for it and override system-specified attributes.
To obtain system-specified storage characteristics:
- Use the mi_lo_spec_init() function to
allocate an LO-specification structure and to initialize this structure
to the appropriate null values.
When a storage characteristic
in the LO-specification structure has the appropriate null value (zero
or a NULL-valued pointer), the smart-large-object optimizer obtains
the system-specified value for the storage characteristic. The smart-large-object
optimizer calculates the system-specified values for disk-storage
storage characteristics. Most applications can use these system-specified
values. For more information, see System-specified storage characteristics.
- Specify the location of the smart large object to override
the default location. You can specify the location as one
of the following:
- The name of the sbspace associated with the CLOB or BLOB column
in which you want to store the smart large object
To store a new
smart large object in a CLOB or BLOB column, use the mi_lo_colinfo_by_name() or mi_lo_colinfo_by_ids() function.
These functions obtain the column-level storage characteristics for
this column. One of the storage characteristics they obtain is the
sbspace name for the column. For more information, see Obtain column-level storage characteristics.
- The name of some other sbspace
You might want to specify an
sbspace name for a new smart large object that is embedded in an opaque
data type. The mi_lo_specset_sbspace() accessor function sets
the name of the sbspace in the LO-specification structure. For more
information, see Define user-specified storage characteristics.
- Optional: Override any attributes for the smart
large object with the mi_lo_specset_flags() accessor function.
The system-specified attributes have both logging and last-access
time disabled. You might want to enable one or more attributes for
the new smart large object. The mi_lo_specset_flags() function
sets the attributes flag in the LO-specification structure. For more
information, see Define user-specified storage characteristics.
- Pass this LO-specification structure to one of the smart-large-object
creation functions (mi_lo_create(), mi_lo_copy(), mi_lo_expand(),
or mi_lo_from_file()) to create the smart large
object.
The smart-large-object creation function creates
a smart large object that has storage characteristics that the LO-specification
structure indicates. For more information, see Initialize an LO-specification structure.
You would probably want to modify the storage characteristics
of the new smart large object in the following cases:
- Your application needs to obtain extra performance.
You can
use other LO-specification accessor functions to change the disk-storage
information of a new smart large object. For more information, see Define user-specified storage characteristics.
- You want to use the storage characteristics of an existing smart
large object.
The mi_lo_stat_cspec() function
can obtain the storage characteristics of an open smart large object
through its LO-status structure. For more information, see Copy storage characteristics from an existing smart large object.