Home | Previous Page | Next Page   Client Functions > Functions for Smart Large Objects >

ifx_lo_readwithseek()

The ifx_lo_readwithseek() function performs a seek operation and then reads data from an open smart large object.

Syntax

ifx_lo_readwithseek(lofd, buf, offset, whence) 

Arguments

The function accepts the following arguments.

Argument Type Use Description
lofd SQL_INTEGER Input Smart-large-object file descriptor
buf SQL_CHAR Output Pointer to a character buffer into which the function will read the data
offset SQL_BIGINT Input Offset from the starting seek position, in bytes. Instead of using the default Informix ODBC Driver C data type of SQL_C_CHAR for offset, use SQL_C_LONG or SQL_C_SHORT. For more information, see SQL_BIGINT.
whence SQL_INTEGER Input Starting seek position. The possible values are:
  • LO_SEEK_CUR: The current seek position in the smart large object
  • LO_SEEK_END: The end of the smart large object
  • LO_SEEK_SET: The start of the smart large object

Usage

The ifx_lo_readwithseek() function performs a seek operation and then reads data from an open smart large object. The read begins at the seek position of lofd that the offset and whence arguments indicate.

The ifx_lo_readwithseek() function reads cbValueMax bytes of data. cbValueMax is an input argument for SQLBindParameter() and SQLBindCol(). Neither the size of buf nor cbValueMax can exceed 2 gigabytes. To read a smart large object that is larger than 2 gigabytes, read it in 2-gigabyte chunks. The ifx_lo_readwithseek() function reads this data into the user-defined buffer to which buf points.

If SQLBindParameter() or SQLBindCol() returns SQL_SUCCESS, then pcbValue, which is an argument for each of these functions, contains the number of bytes that the function read from the smart large object. If SQLBindParameter() or SQLBindCol() returns SQL_SUCCESS_WITH_INFO, then pcbValue contains the number of bytes that are available to read from the smart large object.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]