On Sun, 2005-08-21 at 10:20 -0400, [EMAIL PROTECTED] wrote:

> There was some recent discussion about timestamp triggers, something I
> have been trying to get working on my own.  Specifically, I have two
> fields, insert_ts and last_upd_ts, which I would like to be the insert
> time and last update time, respectively.  However, when I try to write
> a trigger to populate these fields, only last_upd_ts gets populated.
> 
> I have tried two versions of the trigger:
> 
> CREATE TRIGGER task_list_1
> AFTER INSERT ON task_list
>       BEGIN
>               UPDATE task_list
>                 SET insert_ts = datetime('now','localtime'),
>                        last_upd_ts = datetime('now','localtime')
>                 WHERE task_id = NEW.task_id;
>       END;
> 

Both insert_ts and last_upd_ts get updated when I try this.
What version of SQLite are you using?  What platform?  What
language binding?
-- 
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to