Home » SQL & PL/SQL » SQL & PL/SQL » Check Constraints
Check Constraints [message #1725] Fri, 24 May 2002 05:06 Go to next message
C.Naresh Kumar
Messages: 1
Registered: May 2002
Junior Member
Sir
How I gave check constraints for date? for in beteen two days or Individual days?
Re: Check Constraints [message #1728 is a reply to message #1725] Fri, 24 May 2002 06:41 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
1 create table test9
2 (d date check
3* (d between to_date('01-may-2002','dd-mon-yyyy') and to_date('24-may-2002','dd-mon-yyyy')))
SQL> /

Table created.

SQL> insert into test9 values('23-may-2002');

1 row created.

SQL> insert into test9 values (sysdate);
insert into test9 values (sysdate)
*
ERROR at line 1:
ORA-02290: check constraint (MAG.SYS_C001500) violated

SQL> insert into test9 values ('02-may-02');

1 row created.

SQL> insert into test9 values ('02-june-01');
insert into test9 values ('02-june-01')
*
ERROR at line 1:
ORA-02290: check constraint (MAG.SYS_C001500) violated
Previous Topic: no value
Next Topic: Previous Day?
Goto Forum:
  


Current Time: Tue May 21 18:01:34 CDT 2024