I am loading CSV file data into table called EMPLOYEE using SQL*Loader.
My CSV file data is separated by commas (,):
EMPID,EMPNAME,SALARY,GRADE
123,Rams,1000,A1
124,Sand,"2,000",A2
125,Bhas,"3,00,000",A3
and my control file is:
LOAD DATA
Insert INTO TABLE EMPLOYEE
Fields terminated by "," Optionally enclosed by '"' TRAILING NULLCOLS
(
EMPID,
EMPNAME,
SALARY,
GRADE
)
When I load the data using above control file, the first record is loading fine and from the second record there is a problem as there is a comma in salary field (salary is loading in multiple column as there is a comma).
In my data salary field we are getting in double quotes though it has a comma(,). SQL*Loader should consider the value between the double quotes as a single field and salary also should get load properly.
Please suggest changes to be done to load the data properly.
skipif your data file has that header row). What is the actual error you get in the log file? The only obvious thing is that you're relying on the comma inside the salary being seeing as a group separator, and the groups in the last row look odd; but those would give ORA-01722 rather than ignoring the double-quotes.