0

I am trying to load my oracle external table dynamically with multiple .csv files. I am able to load one .csv file but as soon as I alter with new .csv file name, the table gets rewritten.

I have multiple .csv files in a folder which changes everyday with a prefix of the date. Eg file name FileName1_20200607.csv, FileName2_20200607.csv

I dont think there is a way to write 'FileName*20200607.csv' to pick all the files for that date?

My code:

......
ORGANIZATION EXTERNAL 
    ( TYPE ORACLE_LOADER
      DEFAULT DIRECTORY "DATA_DIR_PATH"
      ACCESS PARAMETERS
      ( RECORDS DELIMITED BY NEWLINE BADFILE CRRENG_ORA_APPS_OUT_DIR
   : 'Filebad' DISCARDFILE DATA_OUT_PATH :
   'Filedesc.dsc' LOGFILE DATA_OUT_PATH :
   'Filelog.log' SKIP 0 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED
   BY '"' AND '"' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL
   FIELDS         )
      LOCATION
       ( 'FileName1_20200607.csv', 
         'FileName2_20200607.csv'
       )
    );

But I want to populate these file name dynamically. It should pick up all the file names from the DATA_DIR. There are about 50 other file names. I can add Unix script if need be.

  • 1
    You must look into the answers of this question: https://stackoverflow.com/questions/17405071/load-multiple-csv-into-one-table-by-sqlldr/17406176 – Popeye Jun 08 '20 at 04:15
  • which version of Oracle are you using? – gsalem Jun 08 '20 at 08:29

0 Answers0