How to load single flat file data into multiple staging tables using SQLLoader

Oracle Apps Interview QuestionsCategory: SQL LoaderHow to load single flat file data into multiple staging tables using SQLLoader
narasimha asked 11 months ago
1 Answers
Shailender Thallam Staff answered 6 months ago

Below is an example to load data into two table in one go

OPTIONS (SKIP=1,READSIZE=1000000, BINDSIZE=1000000,ROWS=200,ERRORS=2000)
LOAD DATA INFILE *
TRUNCATE
INTO TABLE XXCUST.XX_ONE_STG
FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘
TRAILING NULLCOLS
(
item_number “LTRIM(RTRIM(:ITEM_NUMBER))”,
organization_code “LTRIM(RTRIM(:ORGANIZATION_CODE))”
)

INTO TABLE XXCUST.XX_TWO_STG
FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘
TRAILING NULLCOLS
(
item_number “LTRIM(RTRIM(:ITEM_NUMBER))”,
organization_code “LTRIM(RTRIM(:ORGANIZATION_CODE))”
)