The mi_streamread_lo() function
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
- A pointer to the stream descriptor for the stream from which to read the smart-large-object data.
- LO_hdl_dptr
- 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 is specified by strm_desc and copies the data to the smart large object at the address in the default sbspace that is specified by LO_hdl_dptr. 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
- 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
- The end of the stream has been reached without any errors.
- MI_STREAM_EBADARG
- The stream descriptor that strm_desc references or the smart large object that LO_hdl_dptr references is invalid.
- MI_ERROR
- The function was not successful.