我的个人虚拟机oracle密码:xxkxx123456(以备后期忘记)

create trigger tri_emp

after insert on employees

for each row

insert into new values(:new.sno,:new.sname,:new.sex,:new.depart)

 

--------------

 

create trigger tri_emp_delete

after delete on employees

for each row

delete from new where sno=:old.sno

 

 

--------------

 

create trigger tri_emp_update

after update on employees

for each row

begin

delete from new where sno=:old.sno;

insert into new values(:new.sno,:new.sname,:new.sex,:new.depart);

end;

 

--------------

注意;的使用,如果在beginend子句中有多条语句的话,每条句子后面都应该有一个分号.