0

I have created a control file using TOADs SQL* Loader Wizard. I have used specified following two tables to load the data but the after running the data has only loaded into one table and a dsc file is generated. Below is the control file I am using:

LOAD DATA
INFILE '\\ANKH\Logs\production export 2012-12-06\BS7666CSV_001.csv' 
BADFILE '\\ANKH\Logs\production export 2012-12-06\BS7666CSV_001.bad'
DISCARDFILE '\\ANKH\Logs\production export 2012-12-06\BS7666CSV_001.dsc'

INTO TABLE "STREET"
TRUNCATE
WHEN (record_id = '11')
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' AND '"'
(RECORD_ID,
CHANGE_TYPE,
PRO_ORDER,
USRN,
TYPE,
AUTH_CODE,
STATE,
STATE_DATE,
SURFACE,
CLASS,
VERSION,
START_DATE,
END_DATE,
LAST_UPDATE_DATE,
ENTRY_DATE,
START_X_COORD,
START_Y_COORD,
END_X_COORD,
END_Y_COORD,
TOLERANCE)

INTO TABLE "STREET_DESCRIPTOR"
TRUNCATE
WHEN (record_id = '15')
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' AND '"'
(RECORD_ID,
CHANGE_TYPE,
PRO_ORDER,
USRN,
DESCRIPTOR,
LOCALITY,
TOWN,
ADMIN_AREA,
LANGUAGE)
nsgulliver
  • 12,655
  • 23
  • 43
  • 64
  • 1
    could you format your SQL? It'll make your question easier to read and thus answer. Try indenting subsections. – Sled Jan 30 '13 at 15:41
  • Sorry about that. I figured it out in any case. I was missing the keyword "POSITION(1)" in my second "INTO TABLE" statement to reset the pointer to the beginning of the record. – Henry Rios Jan 31 '13 at 11:43
  • Please post that as an answer to your own question so that someone else with that problem can use it. – Sled Jan 31 '13 at 14:44

1 Answers1

0

I figured it out that I was missing the keyword POSITION(1) in my second INTO TABLE statement to reset the pointer to the beginning of the record.

Sled
  • 18,541
  • 27
  • 119
  • 168