Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread Mark de Vries
On Sun, 21 Aug 2005, Mark de Vries wrote: > > > 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'), > > >

Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread Mark de Vries
On Sun, 21 Aug 2005, Puneet Kishor wrote: > > On Aug 21, 2005, at 9:20 AM, <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > 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

Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread wkranec
> 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? I'm running sqlite 3.2.2 on Win XP, and I'm running things inside sqlite itself, not another language. Thanks for the help! Bill

Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread D. Richard Hipp
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

Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread Puneet Kishor
On Aug 21, 2005, at 9:55 AM, <[EMAIL PROTECTED]> wrote: can someone explain to me why folks try to accomplish the above using TRIGGERs when the insert time can be set so easily by simply defining the column as insert_ts DATETIME DEFAULT CURRENT_TIMESTAMP and last_upd_ts (or its

Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread wkranec
> can someone explain to me why folks try to accomplish the above using > TRIGGERs when the insert time can be set so easily by simply defining > the column as > > insert_ts DATETIME DEFAULT CURRENT_TIMESTAMP > > and last_upd_ts (or its equivalent) can set in the application logic > and

Re: [sqlite] Can a trigger update more than one column?

2005-08-21 Thread Puneet Kishor
On Aug 21, 2005, at 9:20 AM, <[EMAIL PROTECTED]> wrote: Hi, 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

[sqlite] Can a trigger update more than one column?

2005-08-21 Thread wkranec
Hi, 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