9 lines
296 B
SQL
9 lines
296 B
SQL
CREATE TRIGGER enforceFixedCredit
|
|
BEFORE UPDATE OF account, value ON Credit
|
|
WHEN EXISTS (SELECT * FROM Transfer WHERE credId=NEW.credId)
|
|
AND NOT EXISTS (SELECT * FROM __INTERNAL_TRIGGER_STACK)
|
|
BEGIN
|
|
SELECT RAISE(FAIL, "Credit involved in transactions to revoke at first");
|
|
END;
|
|
|