Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Trying to load Mutliple Files in to one table.

2890297Aug 14 2019 — edited Aug 15 2019

Hi All,

Trying to load multiple csv files in to a single table.

OPTIONS (SKIP=1)

LOAD DATA 

CHARACTERSET WE8ISO8859P1

--infile '/home/applmgr/harish/Ringgold_Files/PROQ_*.csv'

BADFILE '/home/applmgr/harish/Ringgold_Files/rg.bad'

DISCARDFILE '/home/applmgr/harish/Ringgold_Files/rg.ds'

APPEND INTO TABLE XXPQ_RG_SUBS_FULL                                  

FIELDS TERMINATED BY ',' optionally enclosed by '"'

TRAILING NULLCOLS                                                

(                 

   RG_NUMBER                        DECIMAL EXTERNAL NULLIF (RG_NUMBER=BLANKS) 

, RG_NAME                          CHAR NULLIF (RG_NAME=BLANKS)    

, PARENT_COUNTRY                   CHAR NULLIF (PARENT_COUNTRY=BLANKS)        

, PARENT_TIER                      CHAR NULLIF (PARENT_TIER=BLANKS)

, TOP_LEVEL_RIN                    DECIMAL EXTERNAL NULLIF (TOP_LEVEL_RIN=BLANKS)

, TOP_LEVEL_NAME                   CHAR NULLIF (TOP_LEVEL_NAME=BLANKS)   

, TOP_PARENT_COUNTRY               CHAR NULLIF (TOP_PARENT_COUNTRY=BLANKS)        

, SUBSCRIBER_NUMBER                CHAR NULLIF (SUBSCRIBER_NUMBER=BLANKS)     

, SUBSCRIBER_NAME                  CHAR NULLIF (SUBSCRIBER_NAME=BLANKS)  

, CREATED_BY                       CONSTANT '1'

, CREATED_DATE                     SYSDATE       

, LAST_UPDATED_BY                  CONSTANT '1'    

, LAST_UPDATE_DATE                 SYSDATE 

)

Trying to use below batch file:

for %%F in /home/applmgr/harish/Ringgold_Files/PROQ*.csv do sqlldr xxxx/XXXXXs@ebsuat control=xxpq_rg_subs.ctl data=%%F

But it keeps giving me below error :

[applmgr@ebs203 Ringgold_Files]$ r.sh

./r.sh: line 2: syntax error: unexpected end of file

Please let me know what needs to be changed in batch file

Comments

Post Details

Added on Aug 14 2019
4 comments
680 views