[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. > > Interesting...

[sqlite] BEGINNER - Transactions in shell script

2015-09-12 Thread Stephen Chrzanowski
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. > > Interesting It does not exist, but it have article on wikipedia. > Sounds like UFO or Yetti... > "Security

[sqlite] BEGINNER - Transactions in shell script

2015-09-12 Thread Rob Willett
Petr, Since this is the SQLite mailing list, we are moving away from the intentions of the list, however I think your points need addressing as they may be relevant to other people using this mailing list. I apologise to other people if this is off topic but I think its important enough to answ

[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-11 Thread Rob Willett
Petr, You are making a number of fundamental mistakes with your security. 1. Security through obscurity is your first mistake. There is no such thing. 2. Assuming that nobody is writing CGI scripts on Windows Servers is your next mistake. A lot of systems still do this, a lot of old systems

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

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

[sqlite] BEGINNER - Transactions in shell script

2015-09-11 Thread Stephen Chrzanowski
You'd be surprised by what is out there trying to get into your system. I had port 22 open on my home router to go to a Linux machine so I could SSH into my home network from anywhere in the world, even though I rarely ever leave the 519 area code. One day I went to look at my messages log file a

[sqlite] BEGINNER - Transactions in shell script

2015-09-11 Thread John McKown
On Fri, Sep 11, 2015 at 6:51 AM, Stephen Chrzanowski wrote: > You'd be surprised by what is out there trying to get into your system. > > I had port 22 open on my home router to go to a Linux machine so I could > SSH into my home network from anywhere in the world, even though I rarely > ever lea

[sqlite] BEGINNER - Transactions in shell script

2015-09-07 Thread Barry
SQL commands do not need to be on multiple lines (they only need a semicolon after each command). But dot commands do. Have you tried the following? (ECHO .bail on ECHO %multiple commands%) | sqlite3.exe %dbname% But, much more importantly (particularly since you included BEGINNER in big letters

[sqlite] BEGINNER - Transactions in shell script

2015-09-07 Thread Simon Slavin
On 7 Sep 2015, at 8:00am, Petr L?z?ovsk? wrote: > Uhgh Spent lot of time to made whole scripts bundle to use no tempfiles > (avoiding I/Os), and not this ;-) > OK, few more questions: > > Does sqlite3 expect exactly one statement per one line on input? > Or put it into command line? sqlite

[sqlite] BEGINNER - Transactions in shell script

2015-09-07 Thread Petr Lázňovský
Uhgh Spent lot of time to made whole scripts bundle to use no tempfiles (avoiding I/Os), and not this ;-) OK, few more questions: Does sqlite3 expect exactly one statement per one line on input? Or put it into command line? sqlite3.exe %db% "%multiline_statement%" (have seriuos doubts about

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Rowan Worth
On 6 September 2015 at 18:26, Luuk wrote: > > Suppose i have 'test.sql': > .echo on > DELETE FROM test; > BEGIN; > INSERT INTO test VALUES(1,'test1'); > INSERT INTO test VALUES(3,'test3',3); > INSERT INTO test VALUES(2,'test2'); > COMMIT; > SELECT * FROM test; > > And a database 'test.sqlite' with

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 06-09-15 20:46, Petr L?z?ovsk? wrote: > 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

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

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Simon Slavin
On 6 Sep 2015, at 7:46pm, Petr L?z?ovsk? wrote: > Thanks to all answers. Are principles of such script OK, or I miss something? Sorry you cannot script sqlite.exe like that. Each time you run it is a separate session. your BEGIN has no useful effect. Simon.

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Simon Slavin
On 6 Sep 2015, at 2:26pm, Yuriy M. Kaminskiy wrote: > Not quite. Even if some statement failed, if you COMMIT in the end, it > will succeed and database will be (partially) modified. > > It's application developer responsibility to check for errors and issue > ROLLBACK instead of COMMIT, if des

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 06-09-15 15:26, Yuriy M. Kaminskiy wrote: > Luuk writes: > >> DELETE FROM test; >> BEGIN; >> INSERT INTO test VALUES(1,'test1'); >> INSERT INTO test VALUES(3,'test3',3); >> INSERT INTO test VALUES(2,'test2'); >> COMMIT; >> SELECT * FROM test; > (and normally I'd expect to see DELETE *inside*

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Yuriy M. Kaminskiy
Luuk writes: > On 05-09-15 22:27, Simon Slavin wrote: >> On 5 Sep 2015, at 9:18pm, Petr L?z?ovsk? wrote: >> >>> 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

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 05-09-15 22:27, Simon Slavin wrote: > On 5 Sep 2015, at 9:18pm, Petr L?z?ovsk? wrote: > >> 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 t

[sqlite] BEGINNER - Transactions in shell script

2015-09-05 Thread R.Smith
On 2015-09-05 10:18 PM, Petr L?z?ovsk? wrote: > 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 a

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

[sqlite] BEGINNER - Transactions in shell script

2015-09-05 Thread Simon Slavin
On 5 Sep 2015, at 9:18pm, Petr L?z?ovsk? wrote: > 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 writ