I need to load a banch of .csv files from a certain directory. Problem is I also need filenames as they contain information.
I'm managed to load files using similar command:
FOR %c in (C:\tmp\loader\*.csv) DO (
c:\oracle\db\dbhome_1\BIN\sqlldr <user>@<sid>l/<password> control=C:\tmp\loader\loader.ctl data=%c
)
C:\tmp\loader\loader.ctl is (again it's an example)
OPTIONS (ERRORS=0,SKIP=1)
LOAD DATA
APPEND
INTO TABLE scott.td_region_position
FIELDS TERMINATED BY '$$' TRAILING NULLCOLS
( POSITION_KEY,
POSITION_NAME ,
CHANNEL,
LVL,
IS_PARTNER,
MARKET_CODE
)
Can I add the name of files somehow to the loaded information?