List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:June 10 1999 7:24pm
Subject:Re: ERROR 1062 ...
View as plain text  
"Sweeney, Darren L" wrote:
> Hi
> I am running an app where I am pulling data from a table (TableA), if it is
> there, into a form, and then the user completes the form and submits half of
> the data back to TableA, and the other half to another (TableB) ... simple
> enough.
> The first half of the data though (TableA), if it is not there, will leave
> the form fields blank for the user to also complete.
> What I need to do is then update TableA with the new data that the user has
> filled in. When I submit though, if the data was already there it will
> create a duplicate record, which I cannot allow.
> So, my way of thinking is to set one of the columns in TableA to be the
> primary key and then if the data is not there it will be input OK, if it is
> there though, it will cause the ERROR 1062 message and not add to the table.
> This does not feel like the best way to do this but I cannot think of
> another way ... any ideas?
> Thanks
> Darren

Hi Darren

You search for the REPLACE syntax.
This is like any INSERT, but if you try to insert a duplicate, it will "overwrite" the old


ERROR 1062 ...Darren L Sweeney10 Jun
  • Re: ERROR 1062 ...Christian Mack10 Jun
  • Re: ERROR 1062 ...Sasha Pachev10 Jun
RE: ERROR 1062 ...Darren L Sweeney10 Jun