Use REPLACE instead. It is similar to the INSERT except that, it will
replace any old record that match - with the new one. A replace
statement may look like this:
REPLACE INTO TestTable (TestId, User) VALUES ("007","Bond");
HTH
Babs
||> -----Original Message-----
||> From: Andy Ford [mailto:[EMAIL PROTECTED]
||> Sent: Friday, April 23, 2004 1:59 PM
||> To: [EMAIL PROTECTED]
||> Subject: update if insert fails
||>
||> Hi
||>
||> Is there such a statement where, if the insert fails (due to a
duplicate
||> record) an update will happen
||>
||> Thanks
||>
||> Andy
||>
||>
||> --
||> MySQL General Mailing List
||> For list archives: http://lists.mysql.com/mysql
||> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]