当前位置: 移动技术网 > IT编程>数据库>Oracle > 只能在工作时间内更新某表

只能在工作时间内更新某表

2019年03月11日  | 移动技术网IT编程  | 我要评论

移动迷宫3:死亡解药 电影,祼体,野兽派少年少女

例如规定只能在工作时间内更新student表,可以定义如下触发器,其中sysdate为系统当前时间

create or replace trigger secure_student
   before insert or update or delete
   on student
begin
   if    (to_char (sysdate, 'dy') in ('sat', 'sun'))
      or (to_number (sysdate, 'hh24') not between 8 and 17)
   then
      raise_application_error
                    (-20506,
                     'you may only change data during normal business hours.'
                    );
   end if;
end;

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网