要求:一旦对表中的列值进行任何更新OPS_BUILD_ACTIVITY_LABEL
,我们必须在表中插入一行,该行的ACTIVITY_LABEL_AUDIT_LOG
列为TABLE_NAME, COLUMN_NAME, OLD_VALUE, NEW_VALUE, UPDATED_BY, UPDATED_DTM
我创建了如下触发器。使用以下编译错误创建的触发器:
PL/SQL: SQL Statement ignored PL/SQL: ORA-00984: column not allowed here
请帮助我。
create or replace TRIGGER ACTIVITY_LABEL_TRIGGER
AFTER UPDATE OF ACTIVITY_LABEL, NOTES
ON OPS_BUILD_ACTIVITY_LABEL
FOR EACH ROW
BEGIN
INSERT INTO ACTIVITY_LABEL_AUDIT_LOG
( TABLE_NAME,
COLUMN_NAME,
OLD_VALUE,
NEW_VALUE,
UPDATED_BY,
UPDATED_DTM)
VALUES
('OPS_BUILD_ACTIVITY_LABEL',
'ACTIVITY_LABEL',
OLD.ACTIVITY_LABEL,
NEW.ACTIVITY_LABEL,
NEW.LAST_UPDATED_BY,
NEW.LAST_UPDATED_DTM);
END;