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 = DATETIME('now','localtime') WHERE new.a != old.a;
> END;
Make it
CREATE TRIGGER IF NOT EXISTS t_update_a
AFTER UPDATE OF a ON t
BEGIN
UPDATE t SET b = DATETIME('now','localtime') WHERE rowid=new.rowid;
END;
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users