#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    2
    Rep Power
    0
    Hi all!
    Such a problem: i have a table with multiple unique index. Sometimes i need to add some information from txt-file, but records may duplicate; MySQL stops this operation and not adds the rest (maybe, not duplicated) records. How can i solve this problem?
    Thanx.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    81
    Rep Power
    14
    You can either use the REPLACE command (in the docs, look under replace in the index) which will first delete the duplicated entry from the database and insert the new one, or you could write a simple script to go through and only insert when there isn't a duplication (a Perl script to do this would probably only run to a few lines).

Similar Threads

  1. partial indexes
    By Joeba in forum PostgreSQL Help
    Replies: 2
    Last Post: May 25th, 2004, 03:12 PM
  2. selecting duplicate records
    By crackerweb in forum Visual Basic Programming
    Replies: 3
    Last Post: November 12th, 2003, 12:10 PM
  3. process records from stdin
    By dbehera in forum C Programming
    Replies: 0
    Last Post: August 5th, 2003, 02:37 PM
  4. Replies: 0
    Last Post: July 22nd, 2003, 08:56 AM
  5. Replies: 0
    Last Post: June 1st, 2003, 05:48 PM

IMN logo majestic logo threadwatch logo seochat tools logo