Thursday, May 19, 2011

SQL*Loader

How to avoid loading the Header (first Record) of a flat/data file?


Include the following code as part of your control file:-
OPTIONS SKIP=1


How to avoid loading the Trailer (last record) of a flat/data file?


This can be achieved by making use of WHEN condition in control file, provided the trailer contains fixed data.


For Example, if the trailer contains 'T' in the firstcolumn then:- 
LOAD DATA 
INFILE 'test.txt' 
APPEND 
INTO TABLE xxcustom_table 
WHEN (01) <> 'T' 

   column1 ,
   column2 ,
   column3
   .....
)

No comments:

Post a Comment