Re: [sqlite] Strange behavior for timeouts in transactions

2011-12-20 Thread romtek
On Mon, Dec 19, 2011 at 1:34 PM, Pavel Ivanov wrote: > > Yes, this is expected behavior. In this case transaction won't be able > to ever proceed because it can proceed only when writing transaction > in session 1 is committed but it cannot be committed until all reading >

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-20 Thread John Gillespie
This would make a good entry for an Obfuscated SQL contest. Well done John On 19 December 2011 21:43, Nico Williams wrote: > You can do conditionals via WHERE clauses, as others have pointed out. > You can also use WHEN clauses on triggers. > > Think of it as IF .

Re: [sqlite] Strange behavior for timeouts in transactions

2011-12-20 Thread Simon Slavin
On 20 Dec 2011, at 9:03am, romtek wrote: > On Mon, Dec 19, 2011 at 1:34 PM, Pavel Ivanov wrote: >> >> Yes, this is expected behavior. In this case transaction won't be able >> to ever proceed because it can proceed only when writing transaction >> in session 1 is committed

[sqlite] datetime

2011-12-20 Thread Stephen Chrzanowski
I live in GMT-5 (America/Toronto). Current time is 8:06am, which should be 13:06Z. However, according to this: select datetime('now','localtime'),datetime('now','utc'); datetime('now','localtime')datetime('now','utc') 2011-12-20 08:05:242011-12-20 18:05:24 Its 18:05Z. I

Re: [sqlite] datetime

2011-12-20 Thread Kit
2011/12/20 Stephen Chrzanowski : > I live in GMT-5 (America/Toronto).  Current time is 8:06am, which should be > 13:06Z.  However, according to this: > > select datetime('now','localtime'),datetime('now','utc'); > datetime('now','localtime')    datetime('now','utc') >

Re: [sqlite] datetime

2011-12-20 Thread Stephen Chrzanowski
That returned the expected results. So in other words, even though 'UTC' is a valid option, it shouldn't be used? On Tue, Dec 20, 2011 at 8:41 AM, Kit wrote: > 2011/12/20 Stephen Chrzanowski : > > I live in GMT-5 (America/Toronto). Current time is

Re: [sqlite] datetime

2011-12-20 Thread Igor Tandetnik
Stephen Chrzanowski wrote: > I live in GMT-5 (America/Toronto). Current time is 8:06am, which should be > 13:06Z. However, according to this: > > select datetime('now','localtime'),datetime('now','utc'); > datetime('now','localtime')datetime('now','utc') > 2011-12-20

Re: [sqlite] datetime

2011-12-20 Thread Stephen Chrzanowski
That would make sense. Thank you for clearing that up. On Tue, Dec 20, 2011 at 8:50 AM, Igor Tandetnik wrote: > Stephen Chrzanowski wrote: > > I live in GMT-5 (America/Toronto). Current time is 8:06am, which should > be > > 13:06Z. However,

Re: [sqlite] Strange behavior for timeouts in transactions

2011-12-20 Thread romtek
On Tue, Dec 20, 2011 at 6:08 AM, Simon Slavin wrote: > > First, there's more than one way of using SQLite3 from PHP.  There's also the > interface SQLite3:: which is a much thinner wrapper around the basic SQLite C > library.  I have no way of knowing what proportion of

Re: [sqlite] How about the way put a database of SQLite 3 beside web folder?

2011-12-20 Thread romtek
On Fri, Dec 16, 2011 at 8:31 AM, Simon Slavin wrote: > I would not advise putting it in a folder that you are serving to the web > since this would allow anyone browsing yourweb site to inspect the full > contents of the file. One could easily configure the server to

Re: [sqlite] Strange behavior for timeouts in transactions

2011-12-20 Thread Simon Slavin
On 20 Dec 2011, at 5:21pm, romtek wrote: > I'd done some research into this since I asked my question and learned > some things. According to http://bugs.php.net/bug.php?id=38182 and > http://www.serverphorums.com/read.php?7,118071, PDO_SQLITE defaults to > a 60 second busy timeout. This should

[sqlite] insert error

2011-12-20 Thread jim-on-linux
Can someone let me know why the following keeps giving invalid syntax err msg. con = sqlite3.connect(sqldb) cursor = con.cursor() cursor.execute insert into default (rowname) values ( '1' ) ; con.commit() con.close() I get invalid syntax pointing to the t in insert. jimonlinux

Re: [sqlite] insert error

2011-12-20 Thread Petite Abeille
On Dec 20, 2011, at 8:34 PM, jim-on-linux wrote: > cursor.execute insert into default (rowname) values ( '1' ) ; 'default' is a keyword: http://www.sqlite.org/lang_keywords.html If you insist on that name, double quote it. ___ sqlite-users mailing

Re: [sqlite] insert error

2011-12-20 Thread epankoke
Besides that, shouldn't it be cursor.execute "insert into ""default"" (rowname) values('1');" I would expect that the execute command is expecting a string containing the SQL to execute. - Original Message - From: "Petite Abeille" To: "General

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-20 Thread Nico Williams
On Tue, Dec 20, 2011 at 5:21 AM, John Gillespie wrote: > This would make a good entry for an Obfuscated SQL contest. > Well done Thanks, I guess :) It was a fun little SQL ditty to write, and only took a few minutes. (Now I do I a search and see that factorial in SQL is

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-20 Thread Petite Abeille
On Dec 20, 2011, at 9:52 PM, Nico Williams wrote: > It'd be nice to have recursive queries (with tail-call optimization). Yes for recursive with clauses! http://gennick.com/with.html > Then a lot of things get easier. Like solving that damn sodoku puzzle: Solving a Sudoku using Recursive

[sqlite] run a script in Visual Basic.NET

2011-12-20 Thread Esteban Cervetto
How can I run an SQL script written in a txt file in Visual Basic .NET I am using *System.Data.SQLite.dll* 1.0.66.0 library I want to avoid write the SQL code in the visual basic routine. Any Ideas? Regards Esteban ___ sqlite-users mailing list

Re: [sqlite] run a script in Visual Basic.NET

2011-12-20 Thread Simon Slavin
On 21 Dec 2011, at 2:27am, Esteban Cervetto wrote: > How can I run an SQL script written in a txt file in Visual Basic .NET > > I am using *System.Data.SQLite.dll* 1.0.66.0 library > > I want to avoid write the SQL code in the visual basic routine. Either write some Visual BASIC code to