我有一个表 asStudent并且有一个varchar类型列 as status。我需要在此表上为此status列after insert or update过程设置值。我试图为此写一个Trigger。但我不能用作:new.status。它给了Error: ORA-04084: cannot change NEW values for this trigger type。我怎么能这样做?
我的代码
create or replace
TRIGGER STUDENT_AIU_TRI
AFTER INSERT OR UPDATE ON STUDENT
FOR EACH ROW
DECLARE
v_status VARCHAR2(2);
BEGIN
v_status := '1';
select v_status into :NEW.status from dual;
END;