[sqlite] insert image into db - windows batch

2012-01-19 Thread Larry Brasfield
For grins, and because I like scriptable DB operations, I've modified the SQLite shell.c source to make insertion of blobs from files, and extraction of blobs to files, work, efficiently, without extra tools and without changing the representation. The relevant section of the shell's help

Re: [sqlite] insert image into db - windows batch

2012-01-19 Thread Petr Lázňovský
> On Thu, Jan 19, 2012 at 1:49 AM, Kevin Benson wrote: >> On Wed, Jan 18, 2012 at 8:16 PM, Simon Slavin wrote: >>> On 18 Jan 2012, at 11:13pm, Petr Lázňovský wrote: >>> > Look like script for different platform, but "od" and "tr" are >>>

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Kevin Benson
On Thu, Jan 19, 2012 at 1:49 AM, Kevin Benson wrote: > On Wed, Jan 18, 2012 at 8:16 PM, Simon Slavin wrote: > >> >> On 18 Jan 2012, at 11:13pm, Petr Lázňovský wrote: >> >> > Look like script for different platform, but "od" and "tr" are >>

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Kevin Benson
On Wed, Jan 18, 2012 at 8:16 PM, Simon Slavin wrote: > > On 18 Jan 2012, at 11:13pm, Petr Lázňovský wrote: > > > Look like script for different platform, but "od" and "tr" are available > also for Win so I will try... > > I would probably look for a Windows version of

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Kees Nuyt
On Thu, 19 Jan 2012 01:16:26 +, Simon Slavin wrote: > >On 18 Jan 2012, at 11:13pm, Petr Láz?ovský wrote: > >> Look like script for different platform, but "od" and "tr" are available >> also for Win so I will try... > >I would probably look for a Windows version of

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Simon Slavin
On 18 Jan 2012, at 11:13pm, Petr Lázňovský wrote: > Look like script for different platform, but "od" and "tr" are available also > for Win so I will try... I would probably look for a Windows version of 'hexdump'. Simon. ___ sqlite-users mailing

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petr Lázňovský
Look like script for different platform, but "od" and "tr" are available also for Win so I will try... > On Wed, 18 Jan 2012 13:30:49 +0100, Petr Láz?ovský > wrote: have windows batch working with sqlite, may I insert image into database and than read this images

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Tim Streater
On 18 Jan 2012 at 15:24, Petr Lázňovský wrote: >> Sorry, 'windows batch' doesn't mean anything to me. > > http://en.wikipedia.org/wiki/Batch_file > > but wikipedia is reasonlessly turned off today > > > > ___ > sqlite-users mailing

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Teg
Hello Petr, You could Mime encode them to text, insert as a string. Pull them back out as strings, un-mime them. Should be able to do that from a batch file. I keep a bunch of images in Sqlite DB files. It's reasonably fast and I like having them all in one place. Some of the DB files are > 10

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petite Abeille
On Jan 18, 2012, at 4:24 PM, Petr Lázňovský wrote: > but wikipedia is reasonlessly turned off today On the contrary, they have pretty good reasons: http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more https://www.google.com/landing/takeaction/

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Tim Streater
On 18 Jan 2012 at 15:24, Petr Lázňovský wrote: >> Sorry, 'windows batch' doesn't mean anything to me. > > http://en.wikipedia.org/wiki/Batch_file > > but wikipedia is reasonlessly turned off today Looks like you can get round this (at least on OS X / Safari 5.1) by pressing

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petr Lázňovský
> Sorry, 'windows batch' doesn't mean anything to me. http://en.wikipedia.org/wiki/Batch_file but wikipedia is reasonlessly turned off today ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petr Lázňovský
Because of packing. The script should be distributable as one .cmd file, the database engine and database itself will be embeded inside od script. Dealing with embeded files in the shell script is not easy thus I want to minimize its number. L. > On Jan 18, 2012, at 12:00 PM, Petr Lázňovský

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Adam DeVita
You should be able to do it. We put a shot set of hex data in using a script. You likely want to load your file into a variable of hex (or binary) type, if you don't want to write a script that writes a script. Then insert into your_table (f1, blob) values ( your_f1_value ,

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Simon Slavin
On 18 Jan 2012, at 3:02pm, Petr Lázňovský wrote: > did you read the subject of my mail? I am use sqlite from Win batch (shell) > scripting by commands like: > > sqlite3.exe main.db "Insert into Table1 values('','','');" > > or > > sqlite3.exe main.db "select * from Table1 where

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petr Lázňovský
> On 18 Jan 2012, at 12:30pm, Petr Lázňovský wrote: have windows batch working with sqlite, may I insert image into database and than read this images from? >>> Convert your image into a BLOB and store it as a BLOB. BLOBs are just runs >>> of bytes -- you can store anything you want

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petite Abeille
On Jan 18, 2012, at 12:00 PM, Petr Lázňovský wrote: > have windows batch working with sqlite, may I insert image into database and > than read this images from? As pointed out, you might want to use the 'blob' type to store binary data. That said, why bother storing these images inside the

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Simon Slavin
On 18 Jan 2012, at 12:30pm, Petr Lázňovský wrote: >>> have windows batch working with sqlite, may I insert image into database >>> and than read this images from? > >> Convert your image into a BLOB and store it as a BLOB. BLOBs are just runs >> of bytes -- you can store anything you want as

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Petr Lázňovský
>> have windows batch working with sqlite, may I insert image into database and >> than read this images from? > Convert your image into a BLOB and store it as a BLOB. BLOBs are just runs > of bytes -- you can store anything you want as a BLOB. What you mean by "Convert image into a BLOB" is

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Simon Slavin
On 18 Jan 2012, at 11:00am, Petr Lázňovský wrote: > have windows batch working with sqlite, may I insert image into database and > than read this images from? Convert your image into a BLOB and store it as a BLOB. BLOBs are just runs of bytes -- you can store anything you want as a BLOB.

[sqlite] insert image into db - windows batch

2012-01-18 Thread Petr Lázňovský
have windows batch working with sqlite, may I insert image into database and than read this images from? L. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users