就是有个插入触发器,在往表b插数据时,想修改当前插入的这条数据的一个字段name。我应该怎么实现。

解决方案 »

  1.   

    就是:new.字段=xxx赋个新值就行了。
      

  2.   

    那是你不会用:
    SQL> create table test(aaa number);表已创建。SQL> create or replace trigger tr_modify
      2  before insert on test
      3  for each row
      4  begin
      5  :new.aaa:=100;
      6  end;
      7  /触发器已创建SQL> insert into test values(1);已创建 1 行。SQL> select * from test;       AAA
    ----------
           100SQL>
      

  3.   

    我把我代码发你看看
    cc :=‘123544’;
    IF CC IS NOT NULL THEN
        :NEW.COL_NUMBER := CC;
    END IF;
    编译就报错ora-04084:无法更改此触发器类型的new值