List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:January 24 2011 3:42pm
Subject:RE: CURRENT insert ID
View as plain text  
>-----Original Message-----
>From: Donovan Brooke [mailto:lists@stripped]
>Sent: Friday, January 21, 2011 7:28 PM
>Cc: mysql@stripped
>Subject: Re: CURRENT insert ID
>
>Just an idear..
>
>Don't auto_increment the main table.. create a unique Id table,
>auto_increment that, and grab that value first for use with both fields
>in your main table.
>
[JS] I've thought of that, but it creates another problem.

Let's say I add a record to the ID table, thereby auto-incrementing its key. 
Now I need to retrieve that key value. How do I do that while retaining some 
semblance of data integrity? I'd have to do something like "SELECT MAX()", 
which fails to retrieve "my" value if someone else has inserted a record in 
the meantime.

I don't, from Access, have the ability to throw a lock on the table (so far as 
I know). I guess maybe I could do that with pass-through queries, but I'm not 
sure.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site: www.the-infoshop.com




>Donovan
>
>
>--
>D Brooke
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1




Thread
CURRENT insert IDJerry Schwartz21 Jan
  • Re: CURRENT insert IDjoao21 Jan
    • Re: CURRENT insert IDDarryle Steplight21 Jan
  • Re: CURRENT insert IDjoao21 Jan
    • RE: CURRENT insert IDJerry Schwartz21 Jan
      • Re: CURRENT insert IDDonovan Brooke22 Jan
        • Re: CURRENT insert IDJesper Wisborg Krogh22 Jan
        • RE: CURRENT insert IDJerry Schwartz24 Jan
          • Re: CURRENT insert IDMark Goodge24 Jan
      • Re: CURRENT insert IDJaime Crespo Rinc√≥n24 Jan
  • Re: CURRENT insert IDCarsten Pedersen23 Jan
    • Re: CURRENT insert IDCarsten Pedersen23 Jan
    • RE: CURRENT insert IDJerry Schwartz24 Jan
Re: CURRENT insert IDMichael Dykman21 Jan
  • RE: CURRENT insert IDJerry Schwartz21 Jan
    • RE: CURRENT insert IDJerry Schwartz21 Jan
      • RE: CURRENT insert IDJerry Schwartz21 Jan
      • Re: CURRENT insert IDMichael Dykman21 Jan
        • RE: CURRENT insert IDJerry Schwartz21 Jan