5299966837
With FAIL, triggers choke but leave the changes in despite. We need to have the current statement undone, however.
8 lines
161 B
SQL
8 lines
161 B
SQL
CREATE TRIGGER x_spentFromBeginning
|
|
BEFORE INSERT ON Credit
|
|
BEGIN
|
|
SELECT RAISE(ABORT, "credit must be initially unused")
|
|
WHERE NEW.spent != 0;
|
|
END;
|
|
|