Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00901 invalid CREATE command error when creating a Check

754817Sep 6 2010 — edited Sep 6 2010
Hi,
I'm trying to create several checks that 1) ensures a dateFrom is earlier than a dateTo in a ROOM reservation table, and 2) ensures the room type is S, D, or F (for single, double or family).

I used the following code versions and got the ORA-00901 invalid CREATE command below.

CREATE DOMAIN BookingDate AS BookDATE
CHECK(datefrom < dateto);

CREATE DOMAIN RoomType_Check AS CHAR(1)
CHECK(VALUE IN ('S', 'F', 'D'));

create or replace bookdate(
check (value in ('S', 'F', 'D'));

I found a number of references telling me to correct the syntax, but not telling me what is wrong with those I have.

Thanks, R




What am I doing wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2010
Added on Sep 6 2010
4 comments
7,385 views