Unnikrishnan
Unnikrishnan

Reputation: 3303

#1064 - You have an error in your SQL syntax; LOAD DATA LOCAL INFILE

I'm getting #1064 - You have an error in your SQL syntax; in the following MySQL query.

LOAD DATA LOCAL INFILE 'path-to-file.csv' 
INTO TABLE ls_missing_products 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '\"' 
LINES TERMINATED BY '\\r' 
ROWS (ProductID, status) 
SET status = 0;

Following is the full error message i'm getting.

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ROWS (ProductID, status) SET status = 0' at line 1

Upvotes: 0

Views: 265

Answers (1)

Sneha K
Sneha K

Reputation: 38

ROWS is part of IGNORE keyword in LOAD DATA either add IGNORE or remove ROWS. https://dev.mysql.com/doc/refman/5.7/en/load-data.html

Upvotes: 1

Related Questions