On Thu, Jan 13, 2011 at 1:59 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 13 Jan 2011, at 10:48am, Simon Davies wrote:
>
> > CREATE TEMP TRIGGER [UpdatedRowIdTrigger] AFTER UPDATE OF RowId, Id ON
> TestTable
> > BEGIN
> >  UPDATE UpdatedRowId Set Value = new.rowid;
> > END;
>
> His problem is that he doesn't know which rows are aliased to rowid, so he
> can't provide a list of column names.  So the following might be closer
>
> CREATE TEMP TRIGGER [UpdatedRowIdTrigger] AFTER UPDATE ON TestTable
> BEGIN
>  UPDATE UpdatedRowId Set Value = new.rowid WHERE new.rowid != old.rowid;
> END;
>
> But I don't know whether SQLite can actually do that comparison at that
> stage.
>
>

Funny thing we talk so fast I didn't notice that was different Simon ;)

It's ok without comparison, I willl wrap update in before/after sections.
Before-section will table and trigger, after-section willl get the the
actual rowid from temp table and delete both table and trigger. Everything
else can be finished in the code.

Max
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to