Check constraint for column in SQL Developer

Viewed 803

I need to create a table, where the values of column "ttime" can be within the range of 10:00 and 22:00. Here' the code:

create table test (    
  ttime date,
  CONSTRAINT CHECK_ttime CHECK(ttime >= TO_DATE('10:00', 'HH24:MI') AND
                               ttime <= TO_DATE('22:00', 'HH24:MI'))
);

But when I create this table, an error occurs:

ORA-02436: date or system variable wrongly specified in CHECK constraint

How can I avoid it? What's the problem?

1 Answers
Related