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

mi_lo_read()

The mi_lo_read() function reads a specified number of bytes of data from an open smart large object.

Syntax

Usage

The mi_lo_read() function reads nbytes of data from the open smart large object that the LO_fd file descriptor identifies. The read 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 reads this data into the user-allocated buffer that buf references. The buf buffer must be less than 2 gigabytes in size. To read smart large objects that are larger than 2 gigabytes, read them in 2-gigabyte chunks.

To perform a seek operation before a read operation, use the function mi_lo_readwithseek().

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

Return Values

>=0

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

MI_ERROR

The function was not successful.

Related Topics

See the descriptions of the following functions: mi_lo_readwithseek(), mi_lo_seek(), mi_lo_tell(), and mi_lo_write().

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




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