cannot change NEW values for this column type in trigger

来源:互联网 发布:淘宝粉丝抢红包 编辑:程序博客网 时间:2024/05/25 08:13
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;
原创粉丝点击