In this post, we are learning about how to 
skip certain data column while uploading data in database using 
sql loader.
In oracle from version 
Oracle 8i one can specify 
FILLER columns. 
FILLER columns are used to 
skip columns/fields in the load file, ignoring fields that one does not need..
                
                
                
                     Control File Syntax:   
                
                
                    bindsize = n
direct = {TRUE | FALSE}
errors = n
load   = n
multithreading = {TRUE | FALSE}
parallel = {TRUE |FALSE}
readsize = n
resumable = {TRUE | FALSE}
resumable_name = 'ant_string'
resumable_timeout = n
rows = n
silent = {HEADER | FEEDBACK | ERRORS | DISCARDS | PARTITIONS | ALL}
skip = n
skip_index_maintenance = { TRUE | FALSE}
skip_unusable_indexes = { TRUE | FALSE}
streamsize = n
                 
                
                
                 If we need to 
skip unwanted column or
 field from 
loading file or
 data. In below data we want skip 'Name' and 
'DEPARTMENT' field while loading. Look at these examples:               
                
                
                
                     employee.txt (Data File)   
                
                
                    
 ID,NAME,DEPARTMENT,SALARY
 10,Akash,HomeLoanSales,15000
 20,Kufu,Life Insurance,11000
 30,Krishna,Sales,17000
 40,Amol,Marketing,19500
 50,Satya,Antivirus,16000
                 
                
                
                
                     example1.ctl (Control File)   
                
                
                     OPTIONS (SKIP=1)
 LOAD DATA
 INFILE 'd:\dataupload\employee.txt'
 INSERT into table employee
 field terminated by "," optionally enclosed by " " 
 ( 
   id,
   name FILLER,
   dept FILLER,
   salary
 ) 
                 
                
                
               
                Note:- In above control file, to skip name and dept write with FILLER.If we run control file then 'name' and 'dept' column field will be exclude while uploading data using sql loader.
                
               
                
             
        
No comments:
Post a Comment
Please do not enter any spam link in the comment box.