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
感謝AnnyQin和趙老師,已經(jīng)學(xué)習(xí)完所有的慕課網(wǎng)Oracle課程
2018-03-20
當(dāng)oracle數(shù)據(jù)庫在原表中 插入時在觸發(fā)器中要
declare;
PRAGMA AUTONOMOUS_TRANSACTION;
commit
declare;
PRAGMA AUTONOMOUS_TRANSACTION;
commit
2018-03-12
最贊回答 / qq_小灰灰_30
你可以對觸發(fā)器做一下操作--禁用某個表上的所有觸發(fā)器ALTER TABLE 表 DISABLE TRIGGER all--啟用某個表上的所有觸發(fā)器ALTER TABLE 表 enable TRIGGER all--禁用所有表上的所有觸發(fā)器exec sp_msforeachtable 'ALTER TABLE DISABLE TRIGGER all'
2018-03-03