• Oracle数据库多事件触发器案例


    Oracle数据库多事件触发器,在Trigger Body中判断具体事件,举例:

     1 create or replace trigger secure_emp
     2 before
     3 insert or update or delete on cux_employees
     4 
     5 begin
     6   if (to_char(SYSDATE,'DY') IN ('星期六','星期日')) or (to_char(SYSDATE,'HH24') NOT BETWEEN '08' AND '18') then
     7      if deleting then
     8          raise_application_error(-20502,'You may delete from EMPLOYEES table only during business hours.');
     9      elsif inserting then
    10          raise_application_error(-20500,'You may insert into EMPLOYEES table only during business hours.');
    11      elsif updating('salary') then
    12          raise_application_error(-20503,'You may update SALARY only during business hours.');
    13      else
    14          raise_application_error(-20504,'You may update EMPLOYEES table only during normal hours.');
    15      end if;
    16   end if;
    17 end;

    充:

    Oracle触发器产生冲突问题(ORA-04091)的解决方案参考文档:https://wenku.baidu.com/view/a6d40c2bbd64783e09122b7d.html

  • 相关阅读:
    Free DIY Tour_DP
    找出直系亲属_floyd
    Constructing Roads In JGShining's Kingdom_最长上升子序列
    买卖股票_线性dp
    Common Subsequence_公共子序列
    Doing Homework_状态压缩&&位运算
    猴子选大王
    卡片游戏
    Java 2
    Java 1
  • 原文地址:https://www.cnblogs.com/AI-xiaocai/p/11203079.html
Copyright © 2020-2023  润新知