Re: [sqlite] UPDATE TRIGGER works in all records

2009-06-02 Thread Oliver Peters
Am Montag, den 01.06.2009, 07:38 -0400 schrieb Igor Tandetnik: > Oliver Peters wrote: > > After an UPDATE in a record I want the update time stored in a column > > of this record - the problem is that the trigger I use doesn't work > > only in this record but in all others > > > > CREATE TRIGGER

Re: [sqlite] UPDATE TRIGGER works in all records

2009-06-01 Thread Igor Tandetnik
Oliver Peters wrote: > After an UPDATE in a record I want the update time stored in a column > of this record - the problem is that the trigger I use doesn't work > only in this record but in all others > > CREATE TRIGGER IF NOT EXISTS t_update_a > AFTER UPDATE ON t > BEGIN > UPDATE t SET b

Re: [sqlite] UPDATE TRIGGER works in all records

2009-06-01 Thread Pavel Ivanov
Your trigger basically does this: UPDATE t SET b = DATETIME('now','localtime') WHERE 1 != 0; So it updates all rows in the table. Try to change it to this: UPDATE t SET b = DATETIME('now','localtime') WHERE rowid = new.rowid; Pavel On Sun, May 31, 2009 at 7:44 AM, Oliver Peters

[sqlite] UPDATE TRIGGER works in all records

2009-06-01 Thread Oliver Peters
After an UPDATE in a record I want the update time stored in a column of this record - the problem is that the trigger I use doesn't work only in this record but in all others Here's my script for reproduction: - CREATE TABLE IF NOT EXISTS t( a