Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Igor Korot
Simon, On Thu, Oct 31, 2013 at 9:39 PM, Simon Slavin wrote: > > On 1 Nov 2013, at 4:15am, Igor Korot wrote: > >> I'm not trying to change an order of my rows. >> Look at it this way: >> I have a league with some teams. When the league is created the >>

Re: [sqlite] Storing sorted row order in a table

2013-10-31 Thread Igor Tandetnik
On 11/1/2013 12:45 AM, Simon Slavin wrote: Suppose I have a table which has a spare column called "currentOrder". Most of the time this column doesn't matter but occasionally I need to update it to reflect the order that the rows would appear if I did SELECT rowid FROM myTable ORDER BY

[sqlite] Storing sorted row order in a table

2013-10-31 Thread Simon Slavin
Suppose I have a table which has a spare column called "currentOrder". Most of the time this column doesn't matter but occasionally I need to update it to reflect the order that the rows would appear if I did SELECT rowid FROM myTable ORDER BY [order details] The order clause is

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Simon Slavin
On 1 Nov 2013, at 4:15am, Igor Korot wrote: > I'm not trying to change an order of my rows. > Look at it this way: > I have a league with some teams. When the league is created the > players needs to be put in from the players pool. In order to assign > the rank inside the

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Igor Korot
Simon, On Thu, Oct 31, 2013 at 8:51 PM, Simon Slavin wrote: > > On 1 Nov 2013, at 2:15am, Igor Korot wrote: > >> When the record is inserted with the field1 as NULL, I want to have >> the field1 to have value max( field1 ) + 1. >> When the record

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Simon Slavin
On 1 Nov 2013, at 2:15am, Igor Korot wrote: > When the record is inserted with the field1 as NULL, I want to have > the field1 to have value max( field1 ) + 1. > When the record inserted have some value in field1, i.e. field1 == 5, > I want all records that have field1 > 5

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Keith Medcalf
You description is inconsistent with your example. The original trigger matches the "problem description" and the one immediately hereunder matches your transformation example (When the record inserted have some value in field1, i.e. field1 == 5, I want all records that have field1 > 5 to

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Igor Tandetnik
On 10/31/2013 11:26 PM, Keith Medcalf wrote: https://www.sqlite.org/lang_createtrigger.html CREATE TRIGGER foo AFTER INSERT ON table BEGIN UPDATE table SET field1 = field1 + 1 WHERE new.field1 IS NOT NULL AND field1 > new.field1; UPDATE table SET field1 = (SELECT

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Keith Medcalf
https://www.sqlite.org/lang_createtrigger.html CREATE TRIGGER foo AFTER INSERT ON table BEGIN UPDATE table SET field1 = field1 + 1 WHERE new.field1 IS NOT NULL AND field1 > new.field1; UPDATE table SET field1 = (SELECT MAX(field1)+1 FROM table) WHERE rowid = new.rowid AND

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Igor Korot
Igor, On Thu, Oct 31, 2013 at 5:33 PM, Igor Tandetnik wrote: > On 10/31/2013 8:22 PM, Igor Korot wrote: >> >> Hi, ALL, >> In the CREATE TRIGGER can I use something like this: >> >> CREATE TRIGGER foo AFTER INSERT >> BEGIN >> IF foo.field1 IS NULL >> UPDATE

Re: [sqlite] TRIGGER syntax

2013-10-31 Thread Igor Tandetnik
On 10/31/2013 8:22 PM, Igor Korot wrote: Hi, ALL, In the CREATE TRIGGER can I use something like this: CREATE TRIGGER foo AFTER INSERT BEGIN IF foo.field1 IS NULL UPDATE foo SET field1 = ; ELSE UPDATE foo SET field1 = field1 + 1 WHERE field1 > new.; END;

[sqlite] TRIGGER syntax

2013-10-31 Thread Igor Korot
Hi, ALL, In the CREATE TRIGGER can I use something like this: CREATE TRIGGER foo AFTER INSERT BEGIN IF foo.field1 IS NULL UPDATE foo SET field1 = ; ELSE UPDATE foo SET field1 = field1 + 1 WHERE field1 > new.; END; My concern is if CREATE TRIGER will understand

Re: [sqlite] Enable WAL on a QNX system

2013-10-31 Thread Richard Hipp
On Thu, Oct 31, 2013 at 9:56 AM, Sandu Buraga wrote: > Hi, > > I am using SQLite 3.7.9, and QNX 6.5.0 running on Intel x86 machine. I am > having a use-case with multiple readers threads and one writer thread, all > running in the same process. No other process is using

Re: [sqlite] Feature Request: Binding Arrays

2013-10-31 Thread Nico Williams
Oh, and jq is at: https://stedolan.github.io/jq ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Feature Request: Binding Arrays

2013-10-31 Thread Nico Williams
On Wed, Oct 16, 2013 at 07:28:04AM -0400, Richard Hipp wrote: > Please see http://www.sqlite.org/src/artifact/2ece66438?ln=13-75 I've been thinking for a while -ever since I happened upon jq(1)- that a marriage of jq and SQLite3 would be wonderful. jq is a JSON query language. It's a functional

[sqlite] Enable WAL on a QNX system

2013-10-31 Thread Sandu Buraga
Hi, I am using SQLite 3.7.9, and QNX 6.5.0 running on Intel x86 machine. I am having a use-case with multiple readers threads and one writer thread, all running in the same process. No other process is using the SQLite database file. I tried to enable WAL feature, but with no success so far.

Re: [sqlite] Feature Request: Binding Arrays

2013-10-31 Thread Dominique Devienne
On Thu, Oct 31, 2013 at 2:45 AM, Olaf Schmidt wrote: > Am 29.10.2013 13:19, schrieb Dominique Devienne: > >> [...] >> First off, when you use functions like this, you basically rule >> out index use, even if some_column is indexed. That's not good. >> << WHERE col IN

Re: [sqlite] Multi thread access for encrypted database bug

2013-10-31 Thread Richard Hipp
On Thu, Oct 31, 2013 at 8:21 AM, Szomor Akos wrote: > Hi, > > Issue is happening when encrypted database opened by two or more program > same time. > (Databases without encryption are working good.) > The public domain version of SQLite does not do encryption. You must be using

[sqlite] Multi thread access for encrypted database bug

2013-10-31 Thread Szomor Akos
Hi, Issue is happening when encrypted database opened by two or more program same time. (Databases without encryption are working good.) Data modification by the first program is shown by the second one only if it is the first, third, 5th, 7th, etc. (odd) modification sequentially since the

Re: [sqlite] Feature Request: Binding Arrays

2013-10-31 Thread Olaf Schmidt
Am 29.10.2013 13:19, schrieb Dominique Devienne: So, after those functions are in place - where's the problem with: select * from table where InMySmallUnsortedArrayExists(some_column) select * from table where InMyLargerSortedArrayExists(some_column) select * from table where

Re: [sqlite] collation for german "Umlaute"

2013-10-31 Thread Jean-Christophe Deschamps
Search the Internet for an SQLite extension called "unifuzz.c" and see if that does what you want in the way of character folding. I have a copy of the code on my other computer if you cannot find the original authors original code. Here is the download link:

Re: [sqlite] Trigger slows down application start-up

2013-10-31 Thread Igor Korot
Dan, On Thu, Oct 31, 2013 at 1:45 AM, Dan Kennedy wrote: > On 10/31/2013 06:20 AM, Igor Korot wrote: >> >> Hi, Clemens et al, >> >> On Wed, Oct 30, 2013 at 1:11 AM, Igor Korot wrote: >>> >>> Clemens, >>> >>> On Wed, Oct 30, 2013 at 12:47 AM, Igor Korot

Re: [sqlite] Trigger slows down application start-up

2013-10-31 Thread Dan Kennedy
On 10/31/2013 06:20 AM, Igor Korot wrote: Hi, Clemens et al, On Wed, Oct 30, 2013 at 1:11 AM, Igor Korot wrote: Clemens, On Wed, Oct 30, 2013 at 12:47 AM, Igor Korot wrote: On Wed, Oct 30, 2013 at 12:36 AM, Clemens Ladisch wrote: