B
Bigus
I'm inserting a new record into a MySQL table using Perl DBI. I need to
retrieve the unique primary key that's created automatically by the db as
the new record is inserted. Since this will be a multi-user application, and
two different users could be creating new records in that db within a
split-second of each other, I'm not sure whether performing a subsequent
SELECT statement to find out the max number in that column will be
water-tight enough. I would have thought it must be a fairly common desire
to want to know the primary key for a newly inserted record, but can't find
any mention of it in the DBI instructions. Any ideas?
Thanks
Bigus
retrieve the unique primary key that's created automatically by the db as
the new record is inserted. Since this will be a multi-user application, and
two different users could be creating new records in that db within a
split-second of each other, I'm not sure whether performing a subsequent
SELECT statement to find out the max number in that column will be
water-tight enough. I would have thought it must be a fairly common desire
to want to know the primary key for a newly inserted record, but can't find
any mention of it in the DBI instructions. Any ideas?
Thanks
Bigus