tradedb
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
update_balance
Parameters
Name
Type
Mode
Definition
DECLARE negative bool; b float; credit float; BEGIN SELECT allow_negative, balance, credit_line FROM accounts WHERE account_id = NEW .account_id INTO negative, b, credit; UPDATE accounts SET balance = balance + NEW .amount, modified_tstamp = 'now()' WHERE account_id = NEW .account_id; RETURN NEW; END;