Home | Previous Page | Next Page   Function Descriptions >

mi_streamread_lo( )

The mi_streamread_lo( ) function reads smart-large-object data from a stream and copies the data to a smart large object in the default sbspace.

Syntax

mi_integer mi_streamread_lo(strm_desc, LO_hdl_dptr)
   MI_STREAM *strm_desc;
   MI_LO_HANDLE **LO_hdl_dptr;
strm_desc
is a pointer to the stream descriptor for the stream from which to read the smart-large-object data.
LO_hdl_dptr
is a pointer to the buffer to contain the address of the smart large object to which to copy the data.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
No Yes

Usage

The mi_streamread_lo( ) function reads smart-large-object data from the stream that strm_desc references and copies the data to the smart large object at the address that LO_hdl_dptr references, which is always in the default sbspace. To control the location of the smart large object, you can use the mi_streamread_lo_by_lofd( ) function instead.

The read begins at the current seek position of the stream. You can use the mi_stream_tell( ) or mi_stream_getpos( ) function to obtain the current stream seek position.

Important:
The mi_streamread_lo( ) function requires the caller to have an open connection to the database server.

The function is a constructor function for an LO handle. It allocates memory for the LO handle in the current memory duration.

The mi_streamread_lo( ) function is useful in a streamread( ) support function of an opaque data type that contains a smart large object.

Return Values

>=0
is the actual number of bytes that the function has read from the open stream to the smart large object that LO_hdl_dptr references.
MI_STREAM_EEOF
indicates that the end of the stream has been reached without any errors.
MI_STREAM_EBADARG
indicates that the stream descriptor that strm_desc references or the smart large object that LO_hdl_dptr references is invalid.
MI_ERROR
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_stream_getpos( ), mi_stream_read( ), mi_stream_tell( ), mi_streamread_lo_by_lofd( ), and mi_streamwrite_lo( ).

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