The mi_lo_alter() function

The mi_lo_alter() function alters the storage characteristics of an existing smart large object.

Syntax

mi_integer mi_lo_alter(conn, LO_hdl, LO_spec)
   MI_CONNECTION *conn;
   MI_LO_HANDLE *LO_hdl;
   MI_LO_SPEC *LO_spec;
conn
This value is one of the following connection values:

A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().

A NULL-valued pointer (database server only)

LO_hdl
A pointer to an LO handle.
LO_spec
A pointer to an LO-specification structure.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lo_alter() function updates the storage characteristics of an existing smart large object with the characteristics in the LO-specification structure that LO_spec references. With mi_lo_alter(), you can change only the following storage characteristics:
  • Logging characteristics

    You can specify the MI_LO_ATTR_LOG or MI_LO_ATTR_NO_LOG constant for the attributes flag with the mi_lo_specget_flags() function.

  • Last-access time characteristics

    You can specify the MI_LO_ATTR_KEEP_LASTACCESS_TIME or MI_LO_ATTR_NOKEEP_LASTACCESS_TIME constant for the attributes flag with the mi_lo_specget_flags() function.

  • Extent size

    You can store a new integer value for the allocation extent size with the mi_lo_specset_extsz() function. The new extent size applies only to extents written after the mi_lo_alter() function completes.

  • Buffering mode

    You can use mi_lo_alter() to alter the buffering mode of a smart large object that was created with light-weight I/O (MI_LO_NOBUFFER) to buffered I/O (MI_LO_BUFFER) as long as no open instances exist for that smart large object.

    However, mi_lo_alter() generates an error if you attempt to change an open smart large object with buffered I/O to one with light-weight I/O.

The function obtains an exclusive lock for the entire smart large object before it proceeds with the update. It holds this lock until the update completes.

Server only: In a C UDR, the mi_lo_alter() function does not need a connection descriptor to execute. If your UDR does not need a valid connection for other operations, you can specify a NULL-valued pointer for the conn parameter to establish a NULL connection. For information about the advantages of a NULL connection, see the HCL OneDB™ DataBlade® API Programmer's Guide.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful.