SQL Loader questions

From: Jim <cramerj_at_earthlink.net>
Date: 1998/05/13
Message-ID: <01bd7ea3$18c6e960$9b052399_at_cramerj.earthlink.net>#1/1


I am trying to populate two tables in a Master/Detail relationship using a flat file. The file is approximately 200 rows with each row 80 columns, The Master data looks like this in the file:

PCD  ,19980503,6,01        POCONO DOWNS                RACE DATE:  
05/03/1998
RACE: 01       TYPE: LATE BETTING         CLASS: 6000CL             GAIT:
PACE
EVENT:
PURSE: 3,600 TRACK COND: FAST TIME: 0:27.2 - I would like to add data to the Master table from each of these 4 rows. I can add the first row using :

APPEND
INTO TABLE RACE
when (6) = ','

and use other qualifiers for the next rows, however I am stumped at finding a way to define the columns for different rows of data, so that I can populate the table from the values in multiple rows.

Also, I would like to add fields from the Master table to the Detail table, so I can set up a foreign key.

I am trying the statement:

race_num_fk "NVL(:race_num_fk,':race.race_num')"

but this does not work. I need the foreign key to set up the Master/Detail relationship between the two tables. I would prefer not to use a Trigger on the database because I would have to enable and disable it depending on how the table is updated (Form, Loader, etc.).

Thanks for all of your help!

                                                                                                Jim Received on Wed May 13 1998 - 00:00:00 CEST

Original text of this message