17 messages in com.mysql.lists.win32RE: Auto-Increment| From | Sent On | Attachments |
|---|---|---|
| Jill...@Aculab.com | 16 Jun 2003 02:49 | |
| Armin Schöffmann | 16 Jun 2003 02:59 | |
| Robin Keech | 16 Jun 2003 03:25 | |
| Jill...@Aculab.com | 16 Jun 2003 03:28 | |
| Jill...@Aculab.com | 16 Jun 2003 03:37 | |
| Ignatius Reilly | 16 Jun 2003 03:38 | |
| Ignatius Reilly | 16 Jun 2003 04:04 | |
| Armin Schöffmann | 16 Jun 2003 04:08 | |
| Armin Schöffmann | 16 Jun 2003 04:08 | |
| Jill...@Aculab.com | 16 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.com | 16 Jun 2003 04:25 | |
| Alan McDonald | 16 Jun 2003 04:27 | |
| Robin Keech | 16 Jun 2003 05:15 | |
| Ignatius Reilly | 16 Jun 2003 08:05 | |
| Paul DuBois | 20 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...
Robin Keech Java Developer Synectics Ltd
-----Original Message----- From: Armin Schöffmann [mailto:armi...@aegaeon.de] Sent: 16 June 2003 11:00 To: Jill...@Aculab.com; win...@lists.mysql.com Subject: RE: Auto-Increment
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
-- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/win32?unsub=r.ke...@synectics.co.uk
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.474 / Virus Database: 272 - Release Date: 18/04/2003
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.474 / Virus Database: 272 - Release Date: 18/04/2003




