ORA-00906: "missing left parenthesis"

I try to add some constraints but no matter what I do, I get this message, that I m missing left parenthesis..

1.

alter table CUSTOMER
add unique customer.username (username);

2.

ALTER TABLE CUSTOMER 
ADD CONSTRAINT CHECK customer.credit_type (credit_type,'high','average','low');

Any ideas?

Thanks in advance!

Upvotes: 1

Views: 3202

Answers (1)

p.s.w.g
p.s.w.g

Reputation: 148980

It seems like you're looking for this syntax:

ALTER TABLE customer
ADD CONSTRAINT username_unique UNIQUE (username);

ALTER TABLE customer
ADD CONSTRAINT check_credit_type CHECK (credit_type IN ('high','average','low'));

Upvotes: 4

Related Questions