Database Utilities (MOSC)

MOSC Banner

Using SQL Loader with delimited files

edited Oct 8, 2009 2:41AM in Database Utilities (MOSC) 3 commentsAnswered ✓
Hi
I have created a SQL Loader control file as follows:

OPTIONS         (ROWS = 1,ERRORS = 5000)
LOAD DATA

--  Header record
INTO TABLE nfc_int_headers
APPEND
WHEN header = 'HDR'
FIELDS TERMINATED BY "," TRAILING NULLCOLS
(  header  FILLER
 , interface_data_type
 , source_system_code
 , interface_run_id             "TO_NUMBER(:interface_run_id * -1)"
 , previous_interface_complete  "TO_DATE(REPLACE(:previous_interface_complete,' ','0'),'YYYYMMDDHH24MISS')"
 , expiry_date                  "TO_DATE(:expiry_date, 'YYYYMMDD')"
 , site_id
 , timestamp                    SYSDATE
 , file_id                      "nfc_int_data_files_seq.nextval"
)

-- Detail record
INTO TABLE nfc_int_as_data
APPEND
WHEN detail = 'D'
FIELDS TERMINATED BY "," TRAILING NULLCOLS

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center