I can imagine that if a descriptor of the BLOB were stored in the database you could achieve the Oracle case. It would just be a string of page ids much like a file map in a filing system. The complexity would be maintaining it during a vacuum and the performance would suffer from having disk reads of each page in the linked list.

You could of course achieve a similar effect by writing the BLOB to a temporary file and using lseek and read to get it in chunks. You could write it to an anonymous mapped memory area and use a pointer to access it any way you liked and faster.

Andrew Finkenstadt wrote:
Using sqlite3 (3.3.15 or later), is there a method to retrieve portions of a
blob rather than the whole thing?

The equivalent concept in Oracle's programmatic interfaces to C/C++ is by
retrieving a "blob locator" structure instead of the blob itself, and then
using procedural code to access as much of the blob through the blob_locator
as you wish, piecewise, over time.

If not, would others find it useful and handy?

My actual use case is to be able to stream in audio data from a BLOB located
within the larger database archive.  I am aware of alternative solutions,
such as storing the file (name) reference in the database and using standard
file operations to retrieve portions of the file;  I haven't rejected those
solutions, I just prefer the "single archive package" solution for
distribution. :)

--andy



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to