BEGIN UPDATE checking SET balance=balance-5000 WHERE account='Kieesha';
INSERT INTO checking_log(action_date,action,amount) VALUES (SYSDATE,'Transfer to brokerage',-5000);
UPDATE brokerage SET cash_balance=cash_balance+5000 WHERE account='Kiesha';
INSERT INTO brokerage_log(action_date,action,amount) VALUES (SYSDATE,'Tracfer from checking',5000)
COMMIT
EXCEPTION WHEN OTHERS ROLLBACK
END |