[sqlite] Result code differs running commands from script file and from console

2015-03-14 Thread Petr Lázňovský
Just discovered the resulcodes differ if perform: sqlite3.exe %db% < script.sql the %errorlevel% is 1 but by sqlite3.exe %db% "UPDATE table SET '='"; the errorlevel is 19 (correct as by

[sqlite] Result code differs running commands from script file and from console

2015-03-15 Thread Petr Lázňovský
As far as I understood you comment (english is not my first language), executing script could not provided specified resultcode because many fails can occur and exitcode is only one? But multiple fails can occurs on long cmdline too. What happens on this case? My logic says the internal

[sqlite] BEGINNER - Transactions in shell script

2015-09-05 Thread Petr Lázňovský
Have some shell scripts working with sqlite. Receiving incoming payments from bank via HTTP API and pushing it into database. This script will start periodically, every single hour. Want to prevent situation only few payments are written and script failed for some reason. Have read about

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Petr Lázňovský
Thanks to all answers. Are principles of such script OK, or I miss something? set "_error=" sqlite3.exe %db% BEGIN; for /f "tokens=2,3 delims=," %%a in (data.csv) do ( sqlite3 %db% "INSERT INTO payments(id,amount) VALUES ('%%a','%%b')"; if

[sqlite] BEGINNER - Transactions in shell script

2015-09-11 Thread Petr Lázňovský
> SQL commands do not need to be on multiple lines (they only need a > semicolon after each command). > But dot commands do. Good to know > Have you tried the following? > (ECHO .bail on > ECHO %multiple commands%) | sqlite3.exe %dbname% This could be solution, thanks > But, much more

[sqlite] BEGINNER - Transactions in shell script

2015-09-11 Thread Petr Lázňovský
There is a major difference: You are talking about SSH and Linux, this combination running on hundred milions of network devices accross whole internet. Thus develop intruding scripts does make sense. But I am using Windows shell scripts as CGI, which is EXTREMELY rare. Who will study this

[sqlite] BEGINNER - Transactions in shell script

2015-09-11 Thread Petr Lázňovský
> 1. Security through obscurity is your first mistake. There is no such thing. Interesting It does not exist, but it have article on wikipedia. Sounds like UFO or Yetti... > 2. Assuming that nobody is writing CGI scripts on Windows Servers is your > next mistake. A lot of systems still

[sqlite] BEGINNER - Transactions in shell script

2015-09-13 Thread Petr Lázňovský
I would like thanks to all contributors of this interesting debate, for their effort. L. > As with Rob, this is my final say as well. > On Fri, Sep 11, 2015 at 1:38 PM, Petr L?z?ovsk? wrote: >> 1. Security through obscurity is your first mistake. There is no such thing. > >

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-14 Thread Petr Lázňovský
Have following table: CREATE TABLE ip_addr ( /*! Person identificator (PID) %%a */ pid INTEGER PRIMARY KEY NOT NULL, /*! IP address %%b */ ip_addr VARCHAR (16) NOT NULL, /*! Status: 0 - Allowed, Unassigned to specific customer (blocked) */ /*! Status: 1 - Allowed, Asigned to concrete customer */

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-14 Thread Petr Lázňovský
I had googled to verify such idea before, but have no luck. Thanks, L. > Hello Petr, > defining the column pid as INTEGER PRIMARY KEY you added an implicit > contraint; a primary key means that only one record with a given value > of pid can exist in the table. > See

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-15 Thread Petr Lázňovský
Thay track all of us and "optimalise" search results. My list of links could differ from yours. I have googled key phrase '"UNIQUE constraint failed:" sqlite primary key' and similar, but not read whole received documents, perform only brief look on it. This is best practice by my experience,

[sqlite] Windows binaries compiled with ICU

2016-02-28 Thread Petr Lázňovský
Looking for %subj%, unable to find 'sqlite3.exe' with ICU extensions. Does it exist at all? If yes, couls anyone post link? thanks L.

[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

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

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ňov

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ý
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-19 Thread Petr Lázňovský
> On Thu, Jan 19, 2012 at 1:49 AM, Kevin Benson <kevin.m.ben...@gmail.com>wrote: >> On Wed, Jan 18, 2012 at 8:16 PM, Simon Slavin <slav...@bigfraud.org>wrote: >>> On 18 Jan 2012, at 11:13pm, Petr Lázňovský wrote: >>> > Look like scrip