Hmmm... what is this? When using sqlite3_get_table it goes through sqlite3_exec which extracts values from columns with sqlite3_column_text (!!!). What about blobs? A blob can actually contain a number of null bytes! What is the recommended procedure to extract a blob if sqlite3_exec doesn't cut it??
TIA /R > -----Original Message----- > From: Bielik, Robert > Sent: Thursday, February 24, 2005 09:25 > To: sqlite-users@sqlite.org > Subject: [sqlite] ODBC problem > > > Hi, > > I'm using the SQLite 3 ODBC driver at > http://www.ch-werner.de/sqliteodbc/ and DTL > (http://dtemplatelib.sourceforge.net/) and > all works fine until I try to store a BLOB. I've debugged it > so far that when the SQL C type is SQL_C_BINARY, no memory > is allocated in SQLPutData and of course subsequently it will fail. > > One of the problems is that when resolving parameters in the query: > INSERT INTO T_GENERICDATA (ID, DATA) VALUES((?), (?)) > > both parameters are resolved as strings (null terminated). > Now, doesn't SQLite have databinding functions that should be > able to work > binary BLOBs (that could have arbitrary length of zeros) ? > And try to use that instead of the ODBC driver's parameter binding?? > Specifically I don't want the ODBC driver to alloc its own > memory, since suppose the BLOB is of size 10 megabytes, then > the BLOB itself > is 10 MB, then the ODBC will alloc +10 MB, and THEN the query > is executed towards SQLite. I'd like zero-copy operation on BLOBs, but > I don't know enough of the core SQLite3 API to know how to > bind the BLOB to the SQL query. > > Help? > > TIA > /Rob >