이전에도 한번 올렸었으나 만족할만한 답변이 없어서 다시 한번 올립니다.
Check제약에서 날짜 RRRR형식을 사용하면 왜 Error가 발생할까요?
SQL> create table emp123
2 (empno number(10),
3 ename varchar2(20),
4 sal number(10),
5 hiredate date constraint emp123_hiredate_eh
6 check(hiredate between to_date('2015/01/01', 'RRRR/MM/DD')
7 and to_date('2015/12/31', 'RRRR/MM/DD') ) );
--> ERROR at line 6: ORA-02436: date or system variable wrongly specified in CHECK constraint
-------------------------------------------------------------------------------
SQL> create table emp123
2 (empno number(10),
3 ename varchar2(20),
4 sal number(10),
5 hiredate date constraint emp123_hiredate_eh
6 check(hiredate between to_date('2015/01/01', 'YYYY/MM/DD')
7 and to_date('2015/12/31', 'YYYY/MM/DD') ) );
--> Table created.