How to sense (null) in sqlloader? (Original Table created in DB2)

92 Views Asked by At

Example row: |(null)|"2011-03-01"|""| (Note: | separated)

Tried below syntaxes in my ctl file, but none of these worked. From DB2 I get (null)'s in txt file. Because while exporting, employee chose (null) as blanks instead of blank in a tool named AQT. I should sense this and make them NULL. After some research, I tried below 2 but none of them worked.

a) MINQUANTITY NULLIF MINQUANTITY = '(null)'

b) MINQUANTITY "decode(:MINQUANTITY,'(null)',NULL,:MINQUANTITY)",

The question is what should I write in my ctl file to sense this (null) ?

1

There are 1 best solutions below

1
On

Try this as it is the correct syntax for for setting the column to NULL when there are blanks in the data file:

MINQUANTITY  NULLIF(MINQUANTITY=BLANKS)