SQLite Forum

How to write this trigger?
Login
Use the OF and WHEN clause in the trigger.

eg:

```
create trigger upd_t_x after update of x on t when new.x is not old.x
begin
 update t set x = replace(x, 'this', 'that')
  where rowid == new.rowid;
end;
```

Which will cause the trigger to fire if and only if the value of x is updated thus limiting the recursion.