Oracle Apps Search

Sunday, February 21, 2010

SQL Loader

Sometimes when you upload an Excel sheet using SQL* Loader, you want Excel sheet to ignore the Heading of the Excel sheet and want to uplaod from the second record, So you can consider the option of <> in the SQL Statement as below,

OPTIONS (ERRORS=1, SKIP=1)
LOAD DATA
REPLACE
INTO TABLE XXX.TEST
WHEN Inv_It_Ctgry <> 'Inventory Item category'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
( Inv_It_Ctgry CHAR(120)
,SERV CHAR(8)
,CREATED_BY DECIMAL EXTERNAL
,CREATION_DATE DATE(11) "DD-MON-YYYY"
)

And you do not want the Program to give a WARNING on ignoring the First record, for that you add the OPTIONS clause to ignore in case of 1 Record fail, and Skip the Error.


No comments:

Post a Comment