Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sqlldr - replace 'NULL' string with actual NULL value?

796900Sep 9 2010 — edited Sep 23 2010
I 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
This post has been answered by 732412 on Sep 23 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2010
Added on Sep 9 2010
2 comments
5,025 views