You should bind the blob to the prepared insert statement,

insert into first_table (picture_name, picture) values (?,?)

Then sqlite3_bind_text() your name and sqlite3_bind_blob() your image bytes
to the sqlite3_stmt that's the result of sqlite3_prepare().

http://www.sqlite.org/capi3ref.html#sqlite3_prepare

http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob

Or you could use X'53514697465' notation, where any blob can be expressed as
a string in hex preceded by x or X.

insert into first_table (picture_name, picture) values
('dog',X'53514697465')

Hope this helps,

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[EMAIL PROTECTED]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: Srikanth [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 27, 2006 2:15 PM
To: [email protected]
Subject: [sqlite] Inserting image files into a database table

Hi,
Could someone give me the procedure for inserting images into a database
table?
E.g., say I created a table thus:
create table first_table( picture_name string, picture BLOB);

How do I insert an image  into the picture field?

Thanks.
Srikanth.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to