4 Replies Latest reply on Aug 15, 2019 3:50 PM by EdStevens

    Trying to load Mutliple Files in to one table.

    2890297

      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