17 messages in com.mysql.lists.win32RE: Auto-Increment
FromSent OnAttachments
Jill...@Aculab.com16 Jun 2003 02:49 
Armin Schöffmann16 Jun 2003 02:59 
Robin Keech16 Jun 2003 03:25 
Jill...@Aculab.com16 Jun 2003 03:28 
Jill...@Aculab.com16 Jun 2003 03:37 
Ignatius Reilly16 Jun 2003 03:38 
Ignatius Reilly16 Jun 2003 04:04 
Armin Schöffmann16 Jun 2003 04:08 
Armin Schöffmann16 Jun 2003 04:08 
Jill...@Aculab.com16 Jun 2003 04:09 
"Juan F. Capristán W."16 Jun 2003 04:14 
"Juan F. Capristán W."16 Jun 2003 04:20 
Jill...@Aculab.com16 Jun 2003 04:25 
Alan McDonald16 Jun 2003 04:27 
Robin Keech16 Jun 2003 05:15 
Ignatius Reilly16 Jun 2003 08:05 
Paul DuBois20 Jun 2003 21:12 
Subject:RE: Auto-Increment
From:Robin Keech (r.ke@synectics.co.uk)
Date:06/16/2003 03:25:11 AM
List:com.mysql.lists.win32

Just to note, that I think that function works on a per connection basis.

It will give you the last insert id that you/your application made, not a global
one that any connection made.

See

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

As you have realised, this is a two stage process, not atomic as you asked...

Hi! SELECT LAST_INSERT_ID() regards, Armin.

-----Original Message----- From: Jill@Aculab.com [mailto:Jill@Aculab.com] Sent: Monday, June 16, 2003 11:50 AM To: win@lists.mysql.com Subject: Auto-Increment

Suppose you have a table with an auto-incrementing int as primary key.

HOW can you (atomically) add a record to the table and find out what value has been assigned to the primary key of the newly added record?

Jill