I want to load csv file data in SQL but I am getting an error

72 Views Asked by At
LOAD DATA LOW_PRIORITY LOCAL INFILE '/home/worker.csv'
IGNORE INTO TABLE `TEST_db`.`Employee_Info`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\'' ESCAPED BY '\''
LINES TERMINATED BY '\n'
IGNORE 1 LINES (`date`, `Name`, `Gender`, `Mobileno`, `Location`);

I'm getting this error :

1083 (42000): Field separator argument is not what is expected; check the manual
Completed execution in 0.22 minutes

CSV file is in the format of

'2022-10-31','X','Female','91XXXXX','Argentina'
'2022-10-31','Y','Male','71XXXXXX','India'
'2022-10-31','Z','Female','81XXXXXX','UK'
1

There are 1 best solutions below

1
Prity kumari On
LOAD DATA LOW_PRIORITY LOCAL INFILE "/home/worker.csv"
IGNORE INTO TABLE TEST_db.Employee_Info FIELDS TERMINATED BY "," ENCLOSED BY "'"
ESCAPED BY "'" LINES TERMINATED BY "\n" (date, Name, Gender, Mobileno, Location);