List:General Discussion« Previous MessageNext Message »
From:gerald_clark Date:March 16 2006 2:11pm
Subject:Re: What is the proper (least expensive) way to do this
View as plain text  
RedRed!com IT Department wrote:

>
>
> So, for my peace of mind, I would need to follow these procedures to 
> ensure Martijn's issue doesn't happen:
>
> 1. lock the table
> 2. execute my select
> 3. insert if it does not already exist
> 4. unlock the table
>
> On a high level, is this a correct list of procedures?
>
> Sean
>
I would just do the insert, and check for a duplicate key error.
If I get the duplicate key error, then update the record if necessary.

Thread
What is the proper (least expensive) way to do thisConnie A. Logg15 Mar
  • Re: What is the proper (least expensive) way to do thisMartijn Tonies15 Mar
    • Re: What is the proper (least expensive) way to do thisRedRed!com IT Department15 Mar
      • Re: What is the proper (least expensive) way to do thisgerald_clark16 Mar
  • MySQL Query Browser 1.1.20 problemMojtaba Faridzad15 Mar