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

Home -> Community -> Usenet -> c.d.o.server -> Re: Creating Constraints question

Re: Creating Constraints question

From: Sybrand Bakker <oradba_at_sybrandb.demon.nl>
Date: 2000/03/07
Message-ID: <38c4b2d1.5233913@news.demon.nl>#1/1

On Mon, 06 Mar 2000 23:23:34 GMT, argosy22_at_my-deja.com wrote:

>
>
>HI all,
>
>I'm trying to create a constraint.
>
>alter table RFQ_F
>add constraint FK_RFQFP
>foreign key (Rfq_P_Id )
> references RFQ_P_mar01 (Rfq_P_Id)
>
>- works fine.
>
>(drop the constraint here. )
>
>
>alter table RFQ_F
>add constraint FK_RFQFP
>foreign key (Rfq_P_Id )
> references RFQ_P (Rfq_P_Id)
> *
>ERROR at line 3:
>ORA-02270: no matching unique or primary key for this column-list
>
>
>
>The are few differences between RFQ_P_mar01 and RFQ_P.
>Each have exactly the same rows.
>
>The only differences between RFQ_P_mar01 and RFQ_P is that one
>more field is added:
>
>
> RFQ_P_ID NOT NULL NUMBER
> RFQ_ID NOT NULL NUMBER
> VERSION NOT NULL NUMBER <- new field
>added to RFQ_P
>...
>
>and the primary keys are different:
>
>
>RFQ_P Indexes/PK:
>
>INDEX_NAME COLUMN_NAME COLUMN_POSITION
>------------------------------ -------------------- ---------------
>PK_RFQ_P RFQ_P_ID 1
> RFQ_ID 2
> VERSION 3
>
>
>RFQ_P_mar01 Indexes/PK:
>
>INDEX_NAME COLUMN_NAME COLUMN_POSITION
>------------------------------ -------------------- ---------------
>PK_RFQP_ID RFQ_P_ID 1
>
>
>
>So, the question is:
>
>If I make a constraint where one table references the other,
>must it reference the entire primary key, or not?
>
>Or is is something else?
>
>Thanks,
>
>Argosy
>
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

>If I make a constraint where one table references the other,
>must it reference the entire primary key, or not?
Yes!!!!!

Hth,

Sybrand Bakker, Oracle DBA

Hth,

Sybrand Bakker, Oracle DBA Received on Tue Mar 07 2000 - 00:00:00 CST

Original text of this message

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