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!

Error in loading data with double quotes and comma

1063911Sep 16 2014 — edited Sep 17 2014

Hi All,

I have  a csv file of following format:

1,"abcdef",01-JAN-2014

2,"gh"i"jk",02-JAN-2014

3,"lm,no,pq",03-JAN-2014

4,"rst'uvw'xyz",04-JAN-2014

Now my sqlloader control file looks like this:

LOAD DATA

TRUNCATE

INTO TABLE TEST_LOAD

FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

TRAILING NULLCOLS

(test_col1,

test_col2,

test_col3)

This gives following error:

1. no terminator found after TERMINATED and ENCLOSED field - (test_col2 for second row data)

2. If OPTIONALLY ENCLOSED BY '"' is not used - then sql loader will try to insert 'no' in 3rd row into date which throws error

3. Used replace option like -   test_col2 "replace(:test_col2,'\"','-')" and this also gives no terminator found after TERMINATED and ENCLOSED field error.

Please help me in resolving this issue by changing in loader script. CSV file should not be changed.

Thanks,

Balaji

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2014
Added on Sep 16 2014
1 comment
1,303 views