CHECK CONSTRAINT [message #53250] |
Sat, 07 September 2002 02:07 |
saif ali sabri
Messages: 20 Registered: September 2002
|
Junior Member |
|
|
CONSTRAINT trans_dated CHECK (DATED BETWEEN '01-JUL-2002' AND '30-JUN-2003')
what is method to accept this constraint
if datatype is VARCHAR2 then accepted, but insert error
if datatype is DATE then constraint invalid not accepted oracle server.
please told me the proper way to define financial year
|
|
|
Re: CHECK CONSTRAINT [message #53260 is a reply to message #53250] |
Mon, 09 September 2002 10:36 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
The NLS date format (set in itit.ora) would have to match your date format. The correct way is to specify the date format too in your statement:
CONSTRAINT trans_dated CHECK (DATED BETWEEN to_date('01-JUL-2002', 'dd-mon-yyyy') AND to_date('30-JUN-2003', 'dd-mon-yyyy'))
|
|
|