I dumped the SQL being executed to a file:

drop table if exists Words;
create table Words (_id integer primary key autoincrement, text text 
not null unique);
create trigger ut_Words_cannotChangeWordTextOnUpdate before update on 
Words for each row begin select raise(rollback, 'update on table Words 
violates constraint ut_Words_cannotChangeWordTextOnUpdate') where 
OLD.text <> NEW.text;end;
insert into Words (text) values ("word1");
select * from Words;
update Words set text='different_word' where _id=1;

and then ran sqlite3, sending it the contents of the file:

C:\Installs\SQLite>sqlite3 db2 < schema2.txt

The trigger works as expected.

1|word1
SQL error near line 6: update on table Words violates constraint 
ut_Words_cannotChangeWordTextOnUpdate

Unfortunately, it still doesn't work when called via the Android Java 
API over SQLite. Digging into that now. 

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to