我的表格ORDERS
包含很多列:(ORDERS_ID, MEMBER_ID, STATUS, ANY MORE....)
在STATUS
时,我会在新状态“M”中进行更改,我会将ORDERS_ID, MEMBER_ID, STATUS
保存在另一个表XORDERSAUDIT
中。
我写了这个:
CREATE or replace TRIGGER Order_Status_Update_Trigger
AFTER UPDATE OF STATUS ON ORDERS
REFERENCING NEW AS N
FOR EACH ROW
WHEN (N.STATUS = 'M')
BEGIN ATOMIC
INSERT INTO XORDERSAUDIT
(ORDER_ID, USERS_ID, STATUS) VALUES (N.ORDERS_ID, N.MEMBER_ID, N.STATUS);
END;
我有这个错误:
DB2 SQL错误:SQLCODE = -104,SQLSTATE = 42601, SQLERRMC = END-OF-STATEMENT; MEMBER_ID,N.STATUS);, DRIVER = 4.19.66 SQLState:42601 ErrorCode:-104发生错误:
我不明白错误,我尝试纠正但遇到同样的错误,请帮帮我。