Thanks for the incite.
Gloria

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


On 30 Mar 2011, at 5:51pm, Santin, Gloria wrote:

> 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?

You would need, at the very least, a combination of commands probably including 
a pipe.  The unix 'hexdump' command can turn a file into hex if you get the 
options right.  You might be able to use awk or shell scripting to script the 
sqlite3 commandline tool into doing your INSERT for you.

But it's complicated and probably not the way to go.  Write your own little 
command-line utility which reads the file into memory and does your INSERT for 
you.

Simon.
_______________________________________________
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