MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:September 21 2006 1:15pm
Subject:RE: Questions about using mysqlimport to update a table.
View as plain text  
I don't think you can do this with mysqlimport. It wouldn't be hard to do
with Perl or PHP, though, and that could be automated any way you want with
a shell script.


Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

-----Original Message-----
From: Joe User [mailto:mrklipp@stripped]
Sent: Wednesday, September 20, 2006 3:16 PM
To: mysql@stripped
Subject: Questions about using mysqlimport to update a table.

I need to update a table with the contents of a CSV file regularly, I've
used mysqlimport to load all the initial data, but I have a problem with
using it for updates. The data in the CSV file does not contain all of the
data in the table, there is a field that is updated by another application
as well. I need to be able to get updates to the data that is from the CSV
file without deleting the data that is not present from those rows. If I run
it with --ignore, I don't get the updates to rows that are already present,
and if I run it with --replace, I lose the data that wasn't contained within
the CSV file.

I was really hoping to be able to use mysqlmport for this, since I need to
schedule these updates fairly regularly and would like to be able to
automate that process. Is there something I am missing that will make this
work, or do I need to go about it in another way?


Questions about using mysqlimport to update a table.Joe User20 Sep
  • RE: Questions about using mysqlimport to update a table.Jerry Schwartz21 Sep