Thursday, March 4, 2010

Re: Using REPLACE INTO with MySQL

Why do you want to use this, out of  sql standard, statement in the first  place
According to the documentation the operation performed when there is a match id/index is DELETE then INSERT and not UPDATE.
If you have on delete  FK constraint  or any auto increment columns you are going to face some issues.

I  advice you not to use it at all.
Use a stored procedure instead then you can bypass the REPLACE limitation of having a PK   or unique index.
This way you also use one transaction to the database.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: