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

mi_lo_writewithseek()

The mi_lo_writewithseek() function performs a seek operation and then writes a specified number of bytes of data to an open smart large object.

Syntax

Usage

The mi_lo_writewithseek() function writes nbytes of data to the smart large object that the LO_fd file descriptor identifies. The function obtains the data to write from the user-allocated buffer that buf references. The buffer must be less than 2 gigabytes in size.

The write begins at the LO seek position of LO_fd that the offset and whence arguments indicate, as follows:

    This offset value can be negative for all values of whence.

Tip: The mi_lo_writewithseek() function is useful in DataBlade client applications because it reduces the number of round trips between the client application and the database server.

If the database server writes less than nbytes of data to the smart large object, the mi_lo_writewithseek() function returns the number of bytes that it wrote and raises an exception. This condition can occur when the sbspace runs out of space.

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

Return Values

>=0

The number of bytes that the function wrote 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_readwithseek(), mi_lo_seek(), and mi_lo_write().

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.