MySQL Forums
Forum List  »  CSV Storage Engine

ERROR 1064 with LOAD DATA statement (FIELDS COLUMNS)
Posted by: Christoph Kukulies
Date: October 05, 2025 08:43AM

I have the following SQL statement which I source into mysql (5.7.44, Windows 10):

drop table if exists test;
create table test (col1 VARCHAR(64), col2 VARCHAR(80) );
LOAD DATA LOCAL INFILE "t.csv" INTO TABLE test FIELDS OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' COLUMNS TERMINATED BY ';' LINES TERMINATED BY '\r\n' ;

The Data is the following:

E605;^M
E507;^M"A string^M
spanning several lines "some Umlauts in "üöä" to show"^M
escaping^M
last line"^M
E600;"once^M
again"^M

The error occurs when I add the FIELDS related keywords:
FIELDS OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"'

Options: ReplyQuote


Subject
Views
Written By
Posted
ERROR 1064 with LOAD DATA statement (FIELDS COLUMNS)
214
October 05, 2025 08:43AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.