Skip to content Skip to sidebar Skip to footer

Sqlite Trigger Causes "no Such Column" Exception

I'm a newbie with sql triggers and am getting an ESQLiteException on what seems like a simple example. When I try to modify the 'memberTag' column in an existing row, I get the ex

Solution 1:

The problem is in the WHEN clause: the database does not know where memberTag comes from, because there are two possible rows, the old one, and the new one.

Use either OLD.memberTag or NEW.memberTag.

(There is another problem: the UPDATE will change all rows in the table, because you forgot the WHERE clause.)

Post a Comment for "Sqlite Trigger Causes "no Such Column" Exception"