Skip to Main Content

Oracle Database Discussions

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!

SQL Loader with null values

user645399Jun 14 2010 — edited Jun 14 2010
Dear buddies,

I have .dat files which are comma delimited. Here is the example.
abc, xyz, 456
ase, asd, 890
I don't have any problem in loading them using sql loader in normal circumstance.

When there is a null value somewhere around there, for example:
abc, , 456
ase, asd, 890
or
, xyz, 456
ase, asd, 890
I couldn't load them.

How can I fix this error?

Any suggestion?

I am using Oracle 10g R2 running on Windows Server 2003

This is how I connect
$sqlldr userid=userid/password control=d:\load\controlfile\table_name.ctl log=D:\load\log\tablename.log resumable = true errors=0
This is a how the contorl file looks like
LOAD DATA INFILE 'D:\load\dat\tablename.dat' BADFILE 'D:\load\bad\tablename.bad' DISCARDFILE 'D:\load\dat\discard\tablename.dsc' 
INSERT INTO TABLE tablename FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS( col1, col2, col3)
{code}

How can I handle this?

Please advice.

Thanks in advance.

Nith

Edited by: user645399 on Jun 14, 2010 1:38 PM

Edited by: user645399 on Jun 14, 2010 1:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
This post has been answered by Saubhik on Jun 14 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2010
Added on Jun 14 2010
5 comments
2,888 views