Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ddl error? help! please
Comments embedded below
Hth,
Sybrand Bakker, Oracle DBA
"albrrat" <albrrat_at_hotmail.com> wrote in message
news:981907163.856829_at_news2.bigplanet.com...
> ALTER TABLE transaction ADD(CONSTRAINT ck_status CHECK((transaction_status
=
> 'Open') OR (transaction_status = 'Closed'));
>
> ORA-00907: missing right parenthesis
>
As you are using an (albeit redundant) left parenthesis before the word constraint, you'll need an extra right parenthesis before the ;
> and:
>
> ALTER TABLE transaction ADD(CONSTRAINT fk_trans2 FOREIGN KEY(item_id)
> references item(item_id))
>
> *
> ERROR at line 1:
> ORA-02270: no matching unique or primary key for this column-list
>
> pk definition for item is:
>
> ALTER TABLE item ADD(CONSTRAINT cpk_ip_iid_sn_im PRIMARY
> KEY(item_prefix,item_id,item_sequence,item_media));
>
>
Yeah sure. Your foreign key doesn't exactly match your primary key, doesn't
it?
>
>
Received on Sun Feb 11 2001 - 09:52:40 CST
![]() |
![]() |