标签:create int other creat null tput sda after lin
CREATE OR REPLACE TRIGGER check_emp
BEFORE update OR insert OR delete ON emp
--BEFORE 和AFTER指出触发器的触发时序分别为前触发和后触发方式
REFERENCING new AS nn old AS oo
FOR EACH ROW
WHEN (nn.sal > 2000) --判定条件
BEGIN
IF INSERTING THEN
dbms_output.put_line(‘THE OPERATION IS INSERT‘);
--增加INSERT INTO EMP values(7554,‘HIHJ‘,‘RTUT‘,1202,SYSDATE,2700,200,20,null,null
ELSIF UPDATING THEN
dbms_output.put_line(‘THE OPERATION IS UPDATE‘);
--改 UPDATE EMP SET SAL=6000 WHERE EMPNO=7840
ELSIF DELETING THEN
dbms_output.put_line(‘THE OPERATION IS DELETE‘);
--删操作 delete emp where empno=7555
ELSE
dbms_output.put_line(‘OTHERS OPERATION‘);
END IF;
END;
标签:create int other creat null tput sda after lin
原文地址:http://www.cnblogs.com/hyx0920/p/7270149.html