create or replace trigger securityemp
before insert
on emp
declare
begin
if to_char(sysdate,'day') in ('星期六','星期日') or
to_number(to_char(sysdate.'hh24')) not between 9 and 18 then
--禁止insert員工
raise_application_error(-20001,'禁止在非工作時間插入員工');
end if;
end;
/
before insert
on emp
declare
begin
if to_char(sysdate,'day') in ('星期六','星期日') or
to_number(to_char(sysdate.'hh24')) not between 9 and 18 then
--禁止insert員工
raise_application_error(-20001,'禁止在非工作時間插入員工');
end if;
end;
/
2018-06-19
當oracle數據庫在原表中 插入時在觸發器中要
declare;
PRAGMA AUTONOMOUS_TRANSACTION;
commit
declare;
PRAGMA AUTONOMOUS_TRANSACTION;
commit
2018-03-12
最贊回答 / qq_小灰灰_30
你可以對觸發器做一下操作--禁用某個表上的所有觸發器ALTER TABLE 表 DISABLE TRIGGER all--啟用某個表上的所有觸發器ALTER TABLE 表 enable TRIGGER all--禁用所有表上的所有觸發器exec sp_msforeachtable 'ALTER TABLE DISABLE TRIGGER all'
2018-03-03