I started SQLite yesterday and trying stuff. I searched google and stackoverflow for an answer but couldn't find any :( I've created a database and inside that created a few tables income and expense. Then I've inserted 20 entries and tried to make a trigger to log any changes done to entries between 5 - 10. But an error message comes Error: near "where": syntax error
sqlite> CREATE TABLE expense(
...> ID INTEGER PRIMARY KEY AUTOINCREMENT,
...> Category text,
...> Amount real
...> );
sqlite> CREATE TABLE logger(
...> ID int,
...> Time text
...> );
sqlite> CREATE TRIGGER log AFTER UPDATE OF amount ON expense WHERE ID BETWEEN 5 AND 10;
...> BEGIN
...> INSERT INTO logger(ID, time) VALUES(new.ID, datetime('now'));
...> END;
Why doesn't WHERE working? :(
Aucun commentaire:
Enregistrer un commentaire