Results 1 to 2 of 2

Thread: MySQL LOAD DATA Overwrite

  1. #1
    Join Date
    Oct 2009
    Posts
    64

    Question MySQL LOAD DATA Overwrite

    Is there code that will make LOAD DATA INFILE automatically overwrite any duplicates? Right now it appears to skip importing based on matching indexes.

    If there is not a way to force overwrite, do you have any recommendations of how I would easily do this?

    I am importing from a CSV file and what is in the CSV file should always take precedence over what's in the database. But there are other things in the same table in the database that will not have corresponding records in the file.

  2. #2
    Join Date
    Oct 2009
    Posts
    64

    Cool Yay....

    Nevermind, I found the answer.

    http://dev.mysql.com/doc/refman/5.1/en/load-data.html

    LOAD DATA INFILE file_name REPLACE

    Thanks anyways.

Similar Threads

  1. Data Import into MySQL
    By nmaster64 in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 15 Sep 2007, 11:05 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •