感謝老師講解,使得我對(duì)觸發(fā)器有了一個(gè)新的認(rèn)識(shí)?。?!
2018-11-28
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,'禁止在非工作時(shí)間插入員工');
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,'禁止在非工作時(shí)間插入員工');
end if;
end;
/
2018-06-19
感謝AnnyQin和趙老師,已經(jīng)學(xué)習(xí)完所有的慕課網(wǎng)Oracle課程
2018-03-20
當(dāng)oracle數(shù)據(jù)庫在原表中 插入時(shí)在觸發(fā)器中要
declare;
PRAGMA AUTONOMOUS_TRANSACTION;
commit
declare;
PRAGMA AUTONOMOUS_TRANSACTION;
commit
2018-03-12