home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / oracle / 2535 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.4 KB

  1. Path: sparky!uunet!spool.mu.edu!caen!destroyer!fmsrl7!ef2007!fmsrl5!hugh
  2. From: hugh@slee01.srl.ford.com (Hugh Fader)
  3. Newsgroups: comp.databases.oracle
  4. Subject: SQL*Loader foreign key problem
  5. Date: 16 Dec 1992 20:47:25 GMT
  6. Organization: Ford Motor Company Research Laboratory
  7. Lines: 32
  8. Message-ID: <1go4ktINNarb@fmsrl5.srl.ford.com>
  9. Reply-To: hugh@slee01.srl.ford.com
  10. NNTP-Posting-Host: slee06.srl.ford.com
  11. X-Newsreader: Tin 1.1 PL5
  12.  
  13. I am having a problem with SQL*Loader and foreign keys. I have two
  14. tables:
  15.  
  16. CREATE TABLE components(
  17.  id                              NUMBER(4,0)      NOT NULL,
  18.  confignum                       NUMBER(3,0)      NOT NULL
  19.  [other stuff deleted]
  20. )
  21.  
  22. CREATE TABLE conventional_data(
  23.  id                              NUMBER(4,0)      NOT NULL,
  24.  comp_id                         NUMBER(4,0)      NOT NULL,
  25.  [other stuff deleted]
  26. )
  27.  
  28. The conventional_data.comp_id column is a foreign key which references
  29. components.id.
  30.  
  31. Here is my problem: I am trying to load data into the
  32. conventional_data table using SQL*Loader. Each row in the external
  33. file contains a confignum value which is assumed to pre-exist in the
  34. components table. How can I assign a value to
  35. conventional_data.comp_id that points to the appropriate row in the
  36. components table? It seems as though I would have to use a SQL select
  37. in order to do this. Have I hit the limit as to what SQL*Loader can
  38. do?
  39.  
  40. --
  41. Hugh Fader
  42. Ford Research Laboratory
  43. hugh@slee01.srl.ford.com
  44.  
  45.