Oracle创建触发器的普通应用
create trigger triemp
after insert on employees
for each row
insert into new values(:new.sno,:new.sname,:new.sex,:new.depart)
--------------
create trigger triempdelete
after delete on employees
for each row
delete from new where sno=:old.sno
--------------
create trigger triempupdate
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;
--------------
注意;的使用,如果在begin和end子句中有多条语句的话,每条句子后面都应该有一个分号。
分享到: