sqlldr - replace 'NULL' string with actual NULL value?
796900Sep 9 2010 — edited Sep 23 2010I have a file that I'm loading in CSV format. An example of one record is something like this:
ID,FirstName,MiddleName,LastName
1,John,R,Doe
2,Jane,NULL,Doe
3,Jim,F,Doe
My problem lies in the 2nd record. The actual text 'NULL' gets inserted into the middlename field. I know I can use this in my control file to replace it with an actual NULL value...
MIDDLENAME "REPLACE(:MIDDLENAME,'NULL',NULL)"
However, I can't use that since the string "null" could exist somewhere else (if someone's last name was something like "SNULLING" .. bad example, I know).
Is there a way in the control file to use an IF statement to determine if the field is only 'NULL'? I'm having no luck and would appreciate any help... (I'm using 11g R2)
Edited by: user9036239 on Sep 9, 2010 9:18 AM