Do it the other way around.
If insert fails, do the update.
Udate may fail, and before you insert, another tread could do the
insert.
Now your insert would fail, and your data would be lost.
Pål Wester wrote:
>
> Why not do an update regardless if the record exist or not,
> then insert it if y
Why not do an update regardless if the record exist or not,
then insert it if you get an error?
-Opprinnelig melding-
Fra: Artem Koutchine [mailto:[EMAIL PROTECTED]]
Sendt: 26. januar 2001 19:02
Til: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Emne: Re: If exists UPDATE else INSERT
I've seen s