Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Simple Check Constraint Condition Question...
Hello.
I have a simple table example;
create table events (
event_year varchar2(4) not NULL, event_date date not NULL)
What I want is to constrain event_year to be equal to the year portion of event_date. Event_year is entered as a YYYY value.
I think that this is close to what I want in the constraint.
event_year = to_date(event_date, 'YYYY')
However I get a ORA-2436: date or system variable wrongly specified in CHECK constraint.
Does this mean that I should be translating the date to a string?
STeve
-----EOT
Received on Fri Sep 10 1999 - 00:59:12 CDT
![]() |
![]() |