Q:

If Clause in SQL Loader

It is possible to use IF CLAUSE in sql loader? I had written a code but it is giving me error. 
INTO TABLE TF_RTB9_DTL 
WHEN ((01) = 'D') OR (if 
(POA_COU_VAL = 0) 
then MAST_POA_ID = null 
end if) 
FIELDS TERMINATED BY "~" OPTIONALLY ENCLOSED BY '"' 
TRAILING NULLCOLS 
( 

TRANS_TYP POSITION(3), 
BO_ID , 
NAME , 
MID_NAM , 
LAS_NAM , 
PAN , 
NAM_FIR_JOINT , 
MIDD_NAM_FIR_JOINT, 
LAS_NAM_FIR_JOINT , 
PAN_FIR_JOINT , 
NAM_SEC_JOINT , 
MIDD_NAM_SEC_JOINT, 
LAS_NAM_SEC_JOINT , 
PAN_SEC_JOINT , 
ADD_LIN_1 , 
ADD_LIN_2 , 
ADD_LIN_3, 
CITY , 
STATE , 
COUNTRY , 
PIN_COD , 
PERM_ADD_LIN_1 , 
PERM_ADD_LIN_2 , 
PERM_ADD_LIN_3 , 
PERM_CITY , 
PERM_STATE , 
PERM_COUNTRY , 
PERM_PIN_COD , 
POA_COU_VAL , 
MAST_POA_ID , 
TRANS_ID 
)

If POA_COU_VAL is 0 than POA_COU_VAL must be null and next value should be enter in  TRANS_ID. How can I achieve this?

A:

SQL*Loader is a program for loading large batches of data.  It has only limited facilities for manipulating the data during the load process.
If you want to transform the data you should be using external tables instead.  These are very similar to SQL*Loader (the definition uses virtually the same syntax but they present the data file to the database as a table. That means you can use SQL on it.  So instead on invoking SQL*Loader from the command line you woudl run an insert statement like this:
insert into target_table
select * from external table;

Only in your situation you need to explode the project of the SELECT clause so you can include a CASE() statement to implement your additional logic.
Find out more about external tables here. 

