It is possible to attach a stream to a LOB locator, passing the LOB locator as a
(make-instance 'sql:lob-stream ...)
. The value of the
argument must be
. By default, if the stream is closed the LOB locator is freed, unless the value of the initarg
is passed as
Operations via the stream can be mixed with direct operations on the LOB. However, because of the buffering, accessing the LOB contents will give non-obvious results, as other operations may not see something that was written to the stream because it is still in the stream buffer, or the stream may have already read some contents before they were overwritten. Use
before accessing the LOB in other ways to avoid these problems.
It is possible to attach more than one stream to the same LOB locator, in both directions. Apart from the issue of the buffering described above, the streams can be used independently of each other. Note that if you want to close one of the streams and to continue to use the others or the LOB locator itself, you must pass
when you make the stream.
The LOB locator to which a stream is attached can be found by using the reader