SQLite Forum

Error with upsert and trigger WHEN clause?
Login
D'oh! This was just an all around ill-conceived example. I was clearly too sleepy to be coding ;-)

The core issue I was hitting was checking against `name` instead of `new.name` - a silly oversight.

The rest of the things you point out are also totally correct, but in this case they are just artifacts of my (poorly) contriving a non-project-specific example to demonstrate the behavior and leaving out important IRL details like `COLLATE NOCASE`, using a different primary key (or `rowid`) etc... 

Thanks for the detailed and quick response!