Andrew Gilfrin wrote:
> Yep your right of course, I did find it in the docs after I posted.
>
> However you said
>
> "The update is actually completely independent from the insert, so in theory you could even do
> something in another table."
>
> Thats doesn't seem to be the case. It trys the insert and if if fails it does the update using
> the key from the insert.
That may depend on whether the UPDATE part has a WHERE clause or not, and actually accesses the same table as the insert (which it does not have to). I don't remember the exact logic - if it's not in the doc, do try stuff and send report to bugs.mysql.com in the Docs category - then it can be added.
Thanks.
Regards, Arjen.
--
Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Remote expertise & maintenance for MySQL/MariaDB server environments.
Follow us at
http://openquery.com/blog/ &
http://twitter.com/openquery