Database Utilities (MOSC)

MOSC Banner

sqlldr fails when loading csv due to commas in text

edited Jan 14, 2016 10:05AM in Database Utilities (MOSC) 1 commentAnswered

I'm trying to load a CSV.  The text columns are enclosed in double quotes.  But, there are commas inside the quoted columns.  The commas cause incorrect column breaks.  How do I tell SQL loader to ignore the commas inside the columns?

load data

  infile '/home/oracle/Downloads/dvd_csv.txt'

  into table dvd_txt

  fields terminated by "," OPTIONALLY ENCLOSED BY '”'

( DVD_Title,Studio,Released,Status,Sound,Versions,Price,Rating,Year,Genre,Aspect,UPC,DVD_ReleaseDate,ID,datetime)

DVD_Title,Studio,Released,Status,Sound,Versions,Price,Rating,Year,Genre,Aspect,UPC,DVD_ReleaseDate,ID,datetime

"!!!! Beat, Vol. 1: Shows 01 - 05","Bear Family",,"Out","2.0","4:3",35.98,"NR","UNK","Music","1.33:1","4000127201263",2005-05-10 00:00:00,61689,2014-06-10 00:00:00

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center