CREATE OR REPLACE TRIGGER updatecustomername
 before update on item
  REFERENCING OLD AS OLD NEW AS NEW
   FOR EACH ROW 
   BEGIN
   if :NEW.customerid <> 0 then
  select customername
    into :NEW.customername
    from customer where customerid=:NEW.customerid;
    else
    NEW.customername='test';(这句如果是null就是好的)
    end if;
  end;
/
有编译错误,不知道为何