我正在尝试使用Invoice_Total,Payment_Total和Credit_Total的内容更新Balance_Due列。 Three_Numbers函数计算Balance_Due。
我花了很长时间在这上面,并且无法弄清楚正确的语法。这是我到目前为止所拥有的。
CREATE OR REPLACE TRIGGER BALANCE_DUE_BEFORE
BEFORE INSERT OR UPDATE ON INVOICES6
FOR EACH ROW
BEGIN
UPDATE INVOICES6
SET BALANCE_DUE = THREE_NUMBERS(INVOICE_TOTAL, CREDIT_TOTAL, PAYMENT_TOTAL);
END;