[odb-users] update on key duplicate

Boris Kolpackov boris at codesynthesis.com
Wed Nov 28 09:03:26 EST 2012


Hi Davide,

Davide Anastasia <Davide.Anastasia at qualitycapital.com> writes:

> Is there a way to perform something like:
> 
> "INSERT ... ON DUPLICATE KEY UPDATE" 
> 
> with ODB?

No. ODB caches and re-uses prepared statements so adding "modifiers"
like this won't be easy (unless you want it applied for every INSERT).

You can also first do a load(), check if the key is the same, and
then use either insert() or update().

Boris



More information about the odb-users mailing list