> Its a shame that a BLOB handle is not returned as a result of a query > rather than the BLOB itself.
Let me correct you. It's not a shame, it's database specifics and it has its good points. For me personally I'd hate if SQLite returned me some abstract handle if I requested blob value. Note: if you select blob value for example from MS SQL it's also loaded as a whole into servers memory - you just don't care about that. But depending on client implementation the blob value can be also loaded in full into client's memory as well (despite your usage of SQLGetData() function), so this behavior is not something SQLite-specific. Also note: for latest versions of MS SQL Microsoft strongly recommends to not use text and image datatypes (real LOB types) but use varchar(max) and varbinary(max) instead. These types can obtain any value LOBs could get but they also will never return to you any handle in case you've selected them - only the whole value as a bunch. So again as you see this behavior is not SQLite-specific. And the last note: I've never heard of any database engine developer who cares about making it possible to use his DBMS with any other DBMS in a "database independent manner". If somebody needs that "independence" usually he writes database-specific drivers which have independent API and internally handle all cases differently. Pavel On Tue, Dec 29, 2009 at 2:52 AM, Mark Hessling <m...@rexx.org> wrote: > Well that is very disappointing :-( > > Not being able to extract a portion of a BLOB from a result set without > having the complete BLOB in memory makes it impractical to use BLOBs in > SQLite in a database independent manner. > > Its a shame that a BLOB handle is not returned as a result of a query > rather than the BLOB itself. > > Thanks for the clarification anyway. > > Cheers, Mark > > On Mon, 2009-12-28 at 21:17 -0500, Igor Tandetnik wrote: >> Zaher Dirkey wrote: >> > If i want to extract BLOB to a file that mean it is must the whale >> > blob be loaded to memory before can save it? >> >> No, not with BLOB I/O. But you have to be careful: don't mention the BLOB >> field in your SELECT statement, retrieve the ROWID instead. Then use it in >> sqlite3_blob_open call. >> >> Igor Tandetnik >> >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > -- > > * Mark Hessling, m...@rexx.org http://www.rexx.org/ > * Author of THE, a Free XEDIT/KEDIT editor, Rexx/SQL, Rexx/CURL, etc. > * Maintainer of Regina Rexx interpreter and Rexx/Tk > * Use Rexx? join the Rexx Language Association: http://www.rexxla.org/ > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users