Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Can't figure out why this has an error?
create table ITEMS
(
ITEMID number constraint ITEM_PK primary key,
ITEMDESC varchar2(300),
ICAT number constraint FK_ITEM_CAT references CATEGORY,
PRICE number(9,2) constraint PRICE_CHECK check (price is not null and price
> 10),
SOLD char(1) constraint SOLD_CHECK check (sold is not null and sold in
('Y', 'N'))
)
You have missed the SOLD_CHECK(constraint name for the sold column and you
have missed the IS keyword while defining the constarints.
Regards,
Sangeetha
"Vishal" <vabru4u_at_yahoo.com> wrote in message
news:3fc78ae.0403042351.79b28eac_at_posting.google.com...
> create table ITEMS
> (
> ITEMID number constraint ITEM_PK primary key,
> ITEMDESC varchar2(300),
> ICAT number constraint FK_ITEM_CAT references CATEGORY,
> PRICE number(9,2) constraint PRICE_CHECK check (price not null and price >
10),
>
> SOLD char(1) constraint check (sold not null and sold in ('Y', 'N')
>
> );
>
> I get the following error:
>
> PRICE number(9,2) constraint PRICE_CHECK check (price not null and price >
10),
> *
> ERROR at line 6:
> ORA-00920: invalid relational operator
>
> Any ideas? Thanks!
Received on Fri Mar 05 2004 - 02:20:02 CST