How to use Conditional statements in SQL Loader control file
632909May 6 2008 — edited May 7 2008Hi,
I am using sql loader to load a flat file to the table. I am using control file for this purpose as show below:
LOAD
INTO TABLE store_shrink
TRUNCATE
FIELDS TERMINATED BY " "
TRAILING NULLCOLS
(
SITE_ID char,
ST_SHRINK char,
ST_REVENUE char,
SHRINK_PR char ":ST_SHRINK/:ST_REVENUE"
)
My question is this. If in the flat file the value of 'ST_REVENUE' is '0', then I want 'SHRINK_PR' to be '0' as well, and skip the calculation (:st_shrink/:st_revenue).
How to achieve this with the conditional statement or using any Oracle function?
Any help or suggestion is greatly appreciated.
Thanks in advance.