ORA-25003: cannot change NEW values for this column type in trigger
Cause: Attempt to change NEW trigger variables of datatype object, REF, nested table, VARRAY or LOB datatype which is not supported.
Action: Do not change the NEW trigger variables in the trigger body.
放在BEFORE中即可,不要用AFTER:
CREATE OR REPLACE TRIGGER t_temp1
BEFORE INSERT OR UPDATE ON temp1
FOR EACH ROW
DECLARE
BEGIN
IF(:NEW.v1 = '0') THEN
:NEW.v2 := '0';
ELSE
:NEW.v2 := '1';
END IF;
END t_temp1;
Cause: Attempt to change NEW trigger variables of datatype object, REF, nested table, VARRAY or LOB datatype which is not supported.
Action: Do not change the NEW trigger variables in the trigger body.
放在BEFORE中即可,不要用AFTER:
CREATE OR REPLACE TRIGGER t_temp1
BEFORE INSERT OR UPDATE ON temp1
FOR EACH ROW
DECLARE
BEGIN
IF(:NEW.v1 = '0') THEN
:NEW.v2 := '0';
ELSE
:NEW.v2 := '1';
END IF;
END t_temp1;