為什么我的觸發(fā)器不能創(chuàng)建成功?
create or replace trigger securitytest
before insert
on test
begin
? ?if to_char(sysdate,'day') in ('saturday','sunday') or
? ? ? to_number(to_char(sysdate,'hh24')) not between 9 and 18 then
? ? ? raise_application_error(-200001,'cannot insert in woking time');
? ?end if
end;
2016-07-01
test是你自己創(chuàng)建的表嗎??oracle提示的錯(cuò)誤信息是什么?
2016-09-25
百度一下
2016-07-06
1,首先你先用這個(gè)查一下:select ?to_char(sysdate,'day') from dual;,看看結(jié)果是英文還是漢字,如果是漢字,就把:?('saturday','sunday') 改為:?('星期六','星期日') ?
2,raise_application_error(-200001,'cannot insert in woking time'); ?這里的錯(cuò)誤號(hào)參數(shù)的范圍是-20000 到 -20999 ?你這里的-200001不在這個(gè)范圍內(nèi)
2016-07-01
還有一個(gè):是-20001,不是-200001
2016-06-28
create or replace trigger securitytest
before insert
on test
begin
? ?if to_char(sysdate,'day') in ('saturday','sunday') or
? ? ? to_number(to_char(sysdate,'hh24')) not between 9 and 18 then
? ? ? raise_application_error(-200001,'cannot insert in woking time');
? ?end if
end;
?我改成上面的方式也不行呀
2016-06-27
你的不是漢語星期六和星期日所以沒有進(jìn)if判斷