Sorry, my question was not clear enough...
I need to open a file and store the contents into the BLOB field.  Some of the 
files are images and some are document templates.
Can I do that using just SQL commands from a command line?

Thanks,
Gloria

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Jay A. Kreibich
Sent: Wednesday, March 30, 2011 12:44 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Insert BLOB data from the command line

On Wed, Mar 30, 2011 at 12:35:42PM -0400, Santin, Gloria scratched on the wall:
> To all,

> Is there any way to insert into a BLOB field using the insert statement?

  BLOB literals are given as hex strings, with a proceeding 'X'.  For
  example:

    X'deadbeef'

  is a 4-byte BLOB.  You would use it like this:

    INSERT INTO table ( b_col ) VALUES ( X'deadbeef' );

  More info:

    http://sqlite.org/lang_expr.html


   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
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

Reply via email to