MySQL Forums :: Newbie :: Unwanted multiple inserts: Should I use insert or replace into?


Advanced Search

Unwanted multiple inserts: Should I use insert or replace into?
Posted by: jason robinson ()
Date: October 19, 2010 10:11AM

Hi,

I've encountered a strange result with an app I built. For some strange reason (first time after hundreds of inserts) one of my tables has an entry inserted multiple times. It should have done it only once. I have a datestamp on my records and the inserts happened at the exact same time. I do have a primary key – in this case on the memberID.

I'm wondering a)why would this occur and b) how do I prevent this from occurring?

I've read that I could consider using REPLACE INTO instead of INSERT but I'm hoping to understand the issue first before implementing this potential solution.

If it matters at all, I'm using ColdFusion as my server-side code.

Thanks in advance to anyone who can provide some insight.

Jason

Options: ReplyQuote


Subject Written By Posted
Unwanted multiple inserts: Should I use insert or replace into? jason robinson 10/19/2010 10:11AM
Re: Unwanted multiple inserts: Should I use insert or replace into? Large Arnaud 10/19/2010 10:16AM
Re: Unwanted multiple inserts: Should I use insert or replace into? jason robinson 10/19/2010 10:45AM
Re: Unwanted multiple inserts: Should I use insert or replace into? Large Arnaud 10/19/2010 11:01AM
Re: Unwanted multiple inserts: Should I use insert or replace into? jason robinson 10/19/2010 11:39AM
Re: Unwanted multiple inserts: Should I use insert or replace into? Large Arnaud 10/20/2010 12:46AM
Re: Unwanted multiple inserts: Should I use insert or replace into? Rick James 10/21/2010 12:18AM
Re: Unwanted multiple inserts: Should I use insert or replace into? jason robinson 10/21/2010 09:26PM
Re: Unwanted multiple inserts: Should I use insert or replace into? Rick James 10/23/2010 12:59AM
Re: Unwanted multiple inserts: Should I use insert or replace into? Guelphdad Lake 10/21/2010 10:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.