How to use decode function in SQL*Loader to reference fields
Based on the first field We need to load the second field data in Sql*loader.
Here is small script to acheive this
The Control file is test.ctl
into table xxtestref
fields terminated by ',' optionally enclosed by '"'
test2 "decode(:test1, 'hello', 'welcome', :test1)")
this is a test,""
Here the decode function specifies if the data for test1 spells "hello" then
loads "welcome" into test2, otherwise load data from test1.
More about sql*loader
:How to use User Defined Functions in SQL*Loader?