Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: ddl error? help! please

Re: ddl error? help! please

From: albrrat <albrrat_at_hotmail.com>
Date: Sun, 11 Feb 2001 19:53:28 -0500
Message-ID: <981940107.501271@news2.bigplanet.com>

If i include the full composite primary key in the second error listed, I receive an error that there are too many collumns listed. Then what is the answer?

ALTER TABLE transaction ADD(CONSTRAINT fk_trans2 FOREIGN KEY(item_id) references item(item_id))

error:

or:

ALTER TABLE transaction ADD(CONSTRAINT fk_trans2 FOREIGN KEY(item_id)  references item(item_prefix,item_id,item_sequence,item_media))

gives an error also

"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:t8dd73ho8qs14a_at_beta-news.demon.nl...
> 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 - 18:53:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US