List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 18 2002 10:54pm
Subject:Re: Accessing last_insert_id problem.
View as plain text  
At 12:21 +0000 12/18/02, Jeff Snoxell wrote:
>Hi,
>
>I'm adding records to a db using the Perl DBI. Subsequent to adding 
>a record I need to know the value of the auto-incrementing 'Ref' 
>field so that I can place a copy of the relavent details into a log 
>file.
>
>I could query for the "LAST_INSERT_ID" but what if another process 
>has added another record in the interim?

Doesn't matter.

>
>Is this a job for table locking?

No, it's probably more of a job for reading the section on LAST_INSERT_ID()
in the manual again, particularly the part about "cannot be changed by
another client." :-)

http://www.mysql.com/doc/en/Miscellaneous_functions.html

>
>Many thanks,
>
>Jeff

Thread
Executing the "source c:/Test.sql" commandAmit Lonkar18 Dec
  • Re: Executing the "source c:/Test.sql" commandPaul DuBois18 Dec
    • Accessing last_insert_id problem.Jeff Snoxell18 Dec
      • re: Accessing last_insert_id problem.Victoria Reznichenko18 Dec
        • re: Accessing last_insert_id problem.Jeff Snoxell18 Dec
          • re: Accessing last_insert_id problem.Wico de Leeuw18 Dec
          • Re: Accessing last_insert_id problem.Michael T. Babcock18 Dec
          • re: Accessing last_insert_id problem.Paul DuBois18 Dec
            • re: Accessing last_insert_id problem.Jeff Snoxell19 Dec
              • re: Accessing last_insert_id problem.Wico de Leeuw19 Dec
            • thread_cache . what is it ? (no newbie question) .cristian ditoiu20 Dec
              • Re: thread_cache . what is it ? (no newbie question) .Benjamin Pflugmann20 Dec
      • Re: Accessing last_insert_id problem.Paul DuBois18 Dec
      • Re: Accessing last_insert_id problem.Matthew Smith2 Jan
        • Using Perl DBI quote() method with NULL values?Jeff Snoxell7 Jan
          • Re: Using Perl DBI quote() method with NULL values?Paul DuBois7 Jan
          • Re: Using Perl DBI quote() method with NULL values?Keith C. Ivey8 Jan
      • Re: Using Perl DBI quote() method with NULL values?walt7 Jan
      • Re: Using Perl DBI quote() method with NULL values?Rodney Broom8 Jan
      • Re: Using Perl DBI quote() method with NULL values?Salam Baker Shanawa8 Jan
  • Re: Accessing last_insert_id problem.Harald Fuchs18 Dec
Re: Accessing last_insert_id problem.Jeff Snoxell19 Dec
  • Re: Accessing last_insert_id problem.Paul DuBois19 Dec
  • RE: Accessing last_insert_id problem.Will Merrell20 Dec
    • Badly placed ()'s and also access deniedGary Hostetler20 Dec
      • RE: Badly placed ()'s and also access deniedJennifer Goodie20 Dec
        • Re: Badly placed ()'s and also access deniedGary Hostetler20 Dec