2017-02-21 22:24:27 +01:00
|
|
|
CREATE TRIGGER x_changedCredit
|
2017-01-19 21:44:22 +01:00
|
|
|
BEFORE UPDATE OF account, value ON Credit
|
|
|
|
WHEN EXISTS (SELECT * FROM Transfer WHERE credId=NEW.credId)
|
2017-01-22 21:20:17 +01:00
|
|
|
AND NOT EXISTS (SELECT * FROM __INTERNAL_TRIGGER_STACK)
|
2017-01-19 21:44:22 +01:00
|
|
|
BEGIN
|
2017-02-22 21:58:47 +01:00
|
|
|
SELECT RAISE(ABORT, "Credit involved in transactions to revoke at first");
|
2017-01-19 21:44:22 +01:00
|
|
|
END;
|
|
|
|
|