"update" mysql table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jared Hislop
    New Member
    • Sep 2011
    • 1

    "update" mysql table

    I have a csv file that is updated daily through an automated process and adds the new data to the end of the document. I need to find a way to "update" the MySQL table without having to truncate the table then LOAD DATA LOCAL INFILE every time. Is there an "update" command that can pull the newly added data from the spreadsheet and "insert" it into the existing table?
    Any help would be great
    Thanks
    Jared
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Maybe a two step process?
    Use LOAD DATA LOCAL INFILE (although I have never used this) to import the data into a temporary table.
    Then use INSERT INTO ..... ON DUPLICATE KEY UPDATE query to update the main table

    Comment

    Working...