且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

orc-04098在Oracle中使用触发器时出错.

更新时间:2022-12-07 16:36:18

通常,这意味着触发器中存在错误.使用例如SQL * Plus运行命令
Typically this means that you have an error in your trigger. Using for example SQL*Plus run command
SHOW ERRORS TRIGGER TriggerName


看看在交战中有什么错误.

加法:


To see what are the errors in comiplation.

Addition:

CREATE OR REPLACE TRIGGER "MyUser"."TRG2TEST"
BEFORE INSERT ON COMPUTER
FOR EACH ROW
BEGIN
  INSERT INTO COMPUTER (COMPID,COMPNAME,CPU,hdd_size,motherboard,operatingsystem,visible,good)  
  VALUES   
  (SEQ_CompID.NextVal, :new.CompName, :new.CPU, :new.HDD_Size, :new.MotherBoard, :new.OperatingSystem,1,1);
END;



加法2:
添加了FOR EACH ROW,因为它应在插入的每个新行上分别触发.



Addition 2:
Added FOR EACH ROW because this should fire separately on each new row that is inserted.