On 13 January 2011 10:28, Max Vlasov <max.vla...@gmail.com> wrote:
> Simon, I also liked Dan's suggestion, now I'm trying to implement this, but
> it seems that sqlite contains an interesting side effect or I don't know how
> to call it.
>
> if I create the following trigger
>
> CREATE TEMP TRIGGER [UpdatedRowIdTrigger] AFTER UPDATE OF RowId ON TestTable
> BEGIN
>  UPDATE UpdatedRowId Set Value = new.rowid;
> END;
>
> ...this update if fired only if I change rowid explicitly:
> ... UPDATE TestTable SET RowId=1236 WHERE RowId=1235
>  and not if I change the aliased field
> ... UPDATE TestTable SET Id=1236 WHERE Id=1235
>
> (checked in 3.7.4).

CREATE TEMP TRIGGER [UpdatedRowIdTrigger] AFTER UPDATE OF RowId, Id ON TestTable
BEGIN
 UPDATE UpdatedRowId Set Value = new.rowid;
END;

>
> Maybe this functionality is rarely needed (googling "AFTER UPDATE OF RowId"
> leads to a single page in the whole web) so probably nobody noticed this yet
> or it does not work for temp triggers.
>
> I hope I just did something wrong...
>
> Max

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

Reply via email to