I have two tables.They are
CARD(cardid, credit, usertype,charge)
and
PAYMENTDEVICE(paydevid, paydevip,paydevdate, paydevtime, chargedcardid, mealtype).
Mealtype can be 'guest' or 'standard'. I want to update credit that is in card table, when a new row is inserted in paymentdevice. Charge depends on usertype. But if meal type is guest, everyone has to pay 5$ . I try to use following code
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;
But i get this error :
PL/SQL: ORA-00971: missing SET keyword, PL/SQL: SQL Statement ignored. Could you help me please?