标签:存储 lock condition 针对 view proc 名称 调用 ref
数据库触发器是一个与表相关联的,存储的PL/SQL 语句。每当一个特定的数据操作语句(insert update delete)在指定的表上发出时,Oracle自动执行触发器中定义的语句序列。
触发器的应用场景如下:
CREATE [OR REPLACE] TRIGGER trigger_name {BEFORE | AFTER } {INSERT | DELETE | UPDATE [OF column [, column …]]} [OR {INSERT | DELETE | UPDATE [OF column [, column …]]}...] ON [schema.]table_name | [schema.]view_name [REFERENCING {OLD [AS] old | NEW [AS] new| PARENT as parent}] [FOR EACH ROW ] [WHEN condition] PL/SQL_BLOCK | CALL procedure_name;
其中:
create or replace trigger sync_salary after update on emp for each row begin --当主表更新后,自动更新备份表。 update emp_back set sal=:new.sal where empno=:new.empno; end; /
标签:存储 lock condition 针对 view proc 名称 调用 ref
原文地址:https://www.cnblogs.com/collen7788/p/12651278.html