Alex Katebi wrote:
> My problem is that triggers don't trigger until after commit.
> 

No, that is not your problem. You haven't tried anything yet.

This is a trace of SQlite executing the code I posted. There is not a 
commit in sight, and yet it works as expected. I added an unqualified 
select to dump the entire table so you can see the difference.

SQLite version 3.5.7
Enter ".help" for instructions
sqlite> create table t1(name);
sqlite> insert into t1 values('Alex');
sqlite>
sqlite> create table change_log (id integer primary key);
sqlite>
sqlite> create trigger in_t1 after insert on t1
    ...> begin
    ...>     insert into change_log values(new.rowid);
    ...> end;
sqlite>
sqlite> delete from change_log;
sqlite> begin;
sqlite> insert into t1 values('Dennis');
sqlite> select * from t1 where rowid in (select id from change_log);
Dennis
sqlite> select * from t1;
Alex
Dennis
sqlite>

Try it before you decide it won't work.

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

Reply via email to