The ifx_lo_write() function

The ifx_lo_write() function writes a specified number of bytes of data to an open smart large object.

Syntax

mint ifx_lo_write(LO_fd, buf, nbytes, error)
   mint LO_fd;
   char *buf;
   mint nbytes;
   mint *error;
LO_fd
The LO file descriptor for the smart large object to which to write.
buf
A pointer to a buffer that contains the data that the function writes to the smart large object.
nbytes
The number of bytes to write to the smart large object. With a minimum length of 0, this value must be less than 2 GB.
error
A pointer to a mint that contains the error code that ifx_lo_write() sets.

Usage

The ifx_lo_write() function writes nbytes of data to the smart large object that the LO_fd file descriptor identifies. The write begins at the current seek position for LO_fd. You can use the ifx_lo_tell() function to obtain the current seek position.

The function obtains the data from the user-defined buffer to which buf points. The buf buffer must be less than 2 gigabytes in size.

If the database server writes less than nbytes of data to the smart large object, the ifx_lo_write() function returns the number of bytes that it wrote and sets the error value to point to a value that indicates the reason for the incomplete write operation. This condition can occur when the sbspace runs out of space.

Return codes

>=0
The number of bytes that the function has written from the buf character buffer to the open smart large object.
-1
The function was not successful; examine the error for a detailed error code.