Does this answers question?

sqlite> create table log (t);
sqlite> create table t1 (a);
sqlite> create table t2 (a);
sqlite> create trigger tt1 after update on t1 begin
   ...> insert into t2 values (new.a);
   ...> insert into log values ("update of t1, a="||new.a);
   ...> end;
sqlite> create trigger ttt1 after insert on t1 begin
   ...> insert into log values ("insert into t1, a="||new.a);
   ...> end;
sqlite> create trigger ttt2 after insert on t2 begin
   ...> insert into log values ("insert into t2, a="||new.a);
   ...> end;
sqlite> insert into t1 values (1);
sqlite> insert into t1 values (2);
sqlite> insert into t1 values (3);
sqlite> insert into t1 values (4);
sqlite> insert into t1 values (5);
sqlite> update t1 set a = 6;
sqlite> select rowid, t from log;
1|insert into t1, a=1
2|insert into t1, a=2
3|insert into t1, a=3
4|insert into t1, a=4
5|insert into t1, a=5
6|insert into t2, a=6
7|update of t1, a=6
8|insert into t2, a=6
9|update of t1, a=6
10|insert into t2, a=6
11|update of t1, a=6
12|insert into t2, a=6
13|update of t1, a=6
14|insert into t2, a=6
15|update of t1, a=6


Pavel

On Tue, Nov 24, 2009 at 3:20 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> This new implementation of recursive TRIGGERs.  Is it depth-first or 
> width-first ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to