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 -> Foreign Key help (n00b)

Foreign Key help (n00b)

From: <matt_at_mailinator.com>
Date: 1 Sep 2006 12:39:57 -0700
Message-ID: <1157139597.790728.97540@74g2000cwt.googlegroups.com>


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

Original text of this message

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