Thanks Richard,
Ah, I see. Well I did use those functions in the ODBC driver to make writing a
blob work. However, my
current problem is reading the blob. As long as there is no null bytes it
works. But I'm very unsure of the
calling sequence. Ok, say I got a table:
create table T_GENERICDATA (ID INTEGER, DATA BLOB);
and I want to get to a row by select:
select ID,DATA from T_GENERICDATA where ID=(?)
Now the ? will be replaced by %Q by the ODBC driver (sqlite3_vmprintf), so the
resulting SQL string
put into sqlite3_prepare will be 'select ID, DATA from T_GENERICDATA where
ID='1' ' (if ID param was 1).
Ok so far so good. Then what? Should I call sqlite3_step or
sqlite3_column_blob... ?
Eh.. pretty confused...
TIA
/Rob
-----Original Message-----
From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
Sent: Thu 2/24/2005 3:19 PM
To: [email protected]
Cc:
Subject: Re: [sqlite] BLOB problem
On Thu, 2005-02-24 at 15:05 +0100, Bielik, Robert wrote:
> 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??
>
sqlite3_get_table() and sqlite3_exec() are legacy APIs in place to
support
older programs. They are not recommended for new code. Use instead:
sqlite3_prepare()
sqlite3_step()
sqlite3_finalize()