Noor Chaudhry
Noor Chaudhry

Reputation: 73

Convert a CSV to MySQL update statement in Bash

How do I convert CSV file to MySQL update statement in Bash? I can convert it to a INSERT statement, but I want to convert it to update statement and add it to an existing row.

Upvotes: 0

Views: 273

Answers (2)

Bernd Buffen
Bernd Buffen

Reputation: 15057

Import the csv in a new table. update the main table with the new data. remove the new table

Upvotes: 0

robbymarston
robbymarston

Reputation: 356

What exactly are you trying to accomplish? If you simply want to import a mysqldump you can use mysqlimport. See http://dev.mysql.com/doc/refman/5.7/en/mysqlimport.html for more information.

Upvotes: 1

Related Questions