INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

mi_lo_write()

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

Syntax

Usage

The mi_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 LO seek position for LO_fd. You can use the mi_lo_tell() function to obtain the current LO seek position.

The function obtains the data from the user-allocated buffer that buf references. 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 mi_lo_write() function returns the number of bytes that it wrote and raises an exception. This condition can occur when the sbspace runs out of space.

To perform a seek operation before a write operation, use the function mi_lo_writewithseek().

Tip: The mi_lo_write() function replaces the mi_large_object_write() function, which Informix supports for backward compatibility only. Use mi_lo_write() for all new DataBlade routines.

Return Values

>=0

The number of bytes that the function has written from the buf character buffer to open the smart large object.

MI_ERROR

The function was not successful.

Related Topics

See the description of the following functions: mi_lo_read(), mi_lo_seek(), mi_lo_tell(), and mi_lo_writewithseek().

In Chapter 3, "Handling Smart Large Objects," see "Opening a Smart Large Object" and "Writing Data to a Smart Large Object".




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.