Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Foreign Key help (n00b)
hello,
i am trying to create a foreign key on a child table, that links to the primary key on the parent table. the PK on the parent is comprised of two columns, therefor i am trying to make the FK two columns as well, like so:
ALTER TABLE tblTheChild
ADD CONSTRAINT FK_packageID_assetID
FOREIGN KEY (PackageID, AssetID) REFERENCES tblTheParent(PackageID,
AssetID)
...however, when i do this in toad's SQL Edit window, it reports to me "ORA-02298: cannot validate (EDD.FK_PACKAGEID_ASSETID) - parent keys not found". yet, im looking right at that PK in toad, and it is comprised of those two columns.
any idea what i could be doing wrong?
thanks for any insight you may have,
matt
Received on Fri Sep 01 2006 - 14:39:57 CDT
![]() |
![]() |