我有两张桌子。它们是
CARD(cardid, credit, usertype,charge)
和
PAYMENTDEVICE(paydevid, paydevip,paydevdate, paydevtime, chargedcardid, mealtype).
膳食类型可以是“客人”或“标准”。当在支付设备中插入新行时,我想更新卡表中的信用。费用取决于用户类型。但是如果用餐类型是客人,每个人都必须支付5美元。我尝试使用以下代码
CREATE OR REPLACE TRIGGER "TRG_PAYMONEY"
AFTER INSERT
ON PAYMENTDEVICE FOR EACH ROW
BEGIN
UPDATE CARD
WHERE CARDID = :NEW.CHARGEDCARDID
SET CREDIT =
(CASE MEALTYPE
WHEN "STANDARD" THEN CREDIT - CHARGE
WHEN "GUEST" THEN CREDIT - 5
END);
END;
但我得到这个错误:
PL/SQL: ORA-00971: missing SET keyword, PL/SQL: SQL Statement ignored
。请问你能帮帮我吗?