Open a smart large object

You can open a smart large object with the mi_lo_open() function or one of the smart-large-object creation functions: mi_lo_copy(), mi_lo_create(), mi_lo_expand(), or mi_lo_from_file().

These functions open the smart large object in a particular open mode, which in turn determines the lock mode of the smart large object. When you open a smart large object with the mi_lo_copy(), mi_lo_create(), mi_lo_expand(), or mi_lo_open() function, you tell the database server the open mode for the smart large object in either of the following ways:
  • Provide an open mode of zero as an argument to specify use of the default open mode of the smart large object.

    For information about how to associate a default open mode with a smart large object, see Access the default open flag.

  • Provide a nonzero open-mode argument to override the default open mode with an open mode you provide.

    Choose the appropriate open-mode constants from the list in Access the default open flag. If you need to set more than one open-mode value, use the C-language bitwise OR operator (|) to mask open-mode constants together.

Tip: The mi_lo_from_file() function does not require an open mode for the smart large object it creates. It always opens a smart large object in read/write access mode. The smart-large-object optimizer determines which method of access is most efficient (buffered I/O or lightweight I/O).

All these open functions return an LO file descriptor, through which you can access the data of a smart large object as if it were in an operating-system file.