Boris, Thanks. I have few more questions, though. How do I convert an image into its hex equivalent? This is my situation: I would like to a) insert pictures and their captions into a database table and, when needed fetch them and display them in a webpage. I am going to use Python for inserting/fetching the images and their captions. I am not sure, though, how an image can be converted into its hex form, inserted, fetched and then reconverted into an image. I am new to this process, so am not sure how this is done. Thanks Srikanth.
On 3/27/06, Boris Popov <[EMAIL PROTECTED]> wrote: > > 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. > > >

