SQL*Loader foreign key problem

From: Hugh Fader <hugh_at_slee01.srl.ford.com>
Date: 16 Dec 1992 20:47:25 GMT
Message-ID: <1go4ktINNarb_at_fmsrl5.srl.ford.com>


I am having a problem with SQL*Loader and foreign keys. I have two tables:

CREATE TABLE components(

 id                              NUMBER(4,0)      NOT NULL,
 confignum                       NUMBER(3,0)      NOT NULL
 [other stuff deleted]
)

CREATE TABLE conventional_data(

 id                              NUMBER(4,0)      NOT NULL,
 comp_id                         NUMBER(4,0)      NOT NULL,
 [other stuff deleted]
)

The conventional_data.comp_id column is a foreign key which references components.id.

Here is my problem: I am trying to load data into the conventional_data table using SQL*Loader. Each row in the external file contains a confignum value which is assumed to pre-exist in the components table. How can I assign a value to conventional_data.comp_id that points to the appropriate row in the components table? It seems as though I would have to use a SQL select in order to do this. Have I hit the limit as to what SQL*Loader can do?

--
Hugh Fader
Ford Research Laboratory
hugh_at_slee01.srl.ford.com
Received on Wed Dec 16 1992 - 21:47:25 CET

Original text of this message