Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Creating Constraints question
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)
(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:
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 fieldadded 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.
Received on Mon Mar 06 2000 - 00:00:00 CST
![]() |
![]() |