Initialize an LO handle and an LO file descriptor

After you have an LO-specification structure that describes the storage characteristics for the new smart large object, you can create the smart large object with one of the smart-large-object creation functions: mi_lo_copy(), mi_lo_create(), mi_lo_expand(), or mi_lo_from_file(). These smart-large-object creation functions perform the following tasks to create a new smart large object:
  1. Initialize the LO handle for the new smart large object.

    You provide a pointer to an LO handle as an argument to these functions. The creation functions initialize the LO handle with information about the location of the new smart large object.

  2. Store the storage characteristics in a user-supplied LO-specification structure for the new smart large object in the metadata area of the sbspace.

    You provide a pointer to an LO-specification structure as an argument to these functions.

  3. Open the new smart large object in the specified access mode.

    You provide the open mode as an argument to the mi_lo_create(), mi_lo_copy(), or mi_lo_expand() function. The mi_lo_from_file() function opens a smart large object in read/write mode.

  4. Write any associated data to the new smart large object.

    The mi_lo_copy(), mi_lo_expand(), and mi_lo_from_file() function specifies data to write to the sbspace of the new smart large object.

  5. Return an LO file descriptor that identifies the open smart large object.

    The LO file descriptor is needed for most subsequent operations on the smart large object. However, this LO file descriptor is only valid within the current database connection.

These smart-large-object creation functions initialize the following data type structures for a smart large object:
  • An LO handle, which identifies the location of the smart large object and can be stored in a CLOB, BLOB, or opaque-type column
  • An LO file descriptor, which identifies the open smart large object