views:

66

answers:

1

I need to update existing rows in table with load data infile based on some condition, is this possible?

load data infile 'E:/xxx.csv'
into table tld_tod
@aaa, @xxx_date, @ccc
fields terminated by ','
 LINES TERMINATED BY '\r\n'
set xxx = str_to_date(@xxx_date, '%d-%b-%y')
where xxx is not null and aaa=@aaa 

+1  A: 

This is possible.

How to: Use MySQL fast LOAD DATA for UPDATEs

This page is useful too:

LOAD DATA INFILE Syntax

Leniel Macaferi