Re: [sqlite] .importing file into a BLOB

2009-12-10 Thread Jean-Christophe Deschamps
>Something like (one line, wrapped by email): > >echo "INSERT INTO t1 (id,pic) VALUES (1,X'$(od -A n -t x1 >picture.gif | tr -d '\r\n\t\ ')')" | sqlite3 mydb > >(The od utility may be smarter than that, optimization left >to the OP) Looks good, you know better than I do. Just checked: od and tr

Re: [sqlite] .importing file into a BLOB

2009-12-10 Thread Kees Nuyt
On Thu, 10 Dec 2009 04:57:58 +0100, Jean-Christophe Deschamps wrote: > is to >use a command-line tool or combination thereof that will open your >binary file, read each byte in turn and output its hex value in plain >ASCII characters, until end of file. Something like (one line, wrapped by e

Re: [sqlite] .importing file into a BLOB

2009-12-09 Thread Jean-Christophe Deschamps
Ted, >Is it the command-line program misinterpreting the CR/LFs? Unfortunately, any command-line tool will interpret control characters at their face value when they are fed directly. With no ad hoc program doing it for you, the solution, as I've discussed at length before and even if it is fa

Re: [sqlite] .importing file into a BLOB

2009-12-09 Thread Simon Slavin
.import imports data from a file in CSV format. In a CSV file a newline indicates a new record. If you want all your data to be in one record have all your data on one line. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.o

Re: [sqlite] .importing file into a BLOB

2009-12-09 Thread Ted Rolle, Jr.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 09 Dec 2009 11:48:31 -0800 Roger Binns wrote: > http://catb.org/~esr/faqs/smart-questions.html What wasn't clear? I apologize for any murkiness. My understanding is that a BLOB takes any piece of data and stores it away intact. Is it the co

Re: [sqlite] .importing file into a BLOB

2009-12-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ted Rolle, Jr. wrote: > When I insert a gpg-encrypted .asc file command-line sqlite3 inserts > each line as a separate BLOB. > This is not what I want. > I want the whole file to be in the BLOB. > I tried inserting a .gpg file but x'0a' signals a new l

[sqlite] .importing file into a BLOB

2009-12-09 Thread Ted Rolle, Jr.
When I insert a gpg-encrypted .asc file command-line sqlite3 inserts each line as a separate BLOB. This is not what I want. I want the whole file to be in the BLOB. I tried inserting a .gpg file but x'0a' signals a new line with resulting 'Expected 1 column but found 2'. Where to from here? --- ___