LAST_INSERT_ID is held for the database connection, not agaist the
server

So, as long as you do not do another insert using the same database
connection, LAST_INSERT_ID will be fine.

(for database connection, $dbh=DBI->connect..... )

No table locking required.


Regards

M



On Wed, 18 Dec 2002, Jeff Snoxell wrote:

> Date: Wed, 18 Dec 2002 12:21:14 +0000
> From: Jeff Snoxell <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Accessing last_insert_id problem.
>
> 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?
>
> Is this a job for table locking?
>
> Many thanks,
>
> Jeff
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

-- 
Matthew Smith
Nominet UK



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to