The mi_lo_truncate() function

The mi_lo_truncate() function truncates a smart large object at a specified byte position.

Syntax

mi_integer mi_lo_truncate(conn, LO_fd, offset)
   MI_CONNECTION *conn;
   MI_LO_FD LO_fd;
   mi_int8 *offset;
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_fd
An LO file descriptor for the open smart large object whose value you want to truncate.
offset
A pointer to the eight-byte integer (mi_int8) that identifies the offset at which the truncation of the smart large object begins.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lo_truncate() function sets the last valid byte of a smart large object to the specified offset value. If this offset value is less than the current end of the smart large object, the database server reclaims all storage, from the position that offset indicates to the end of the smart large object.

Server only: The mi_lo_truncate() 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.