consecutive ids in a batch insert?
am 22.08.2006 01:27:15 von varacHi list,
I am new to mysql and would appreciate any advice that you have to
offer.
I am attempting to batch insert 100 rows into a table, and I need to
know the 100 id's of all the inserted rows.
I know that I can find the id of the last inserted row despite my app
being multi-threaded, since the select last inserted command is
connection-specific.
Given the id of the last inserted row, can I back out all the ids of
the inserted rows? Are the inserts consecutive in an auto-increment
table?
If not, I will be looking to lock the table during inserts, but that
seems very sub-optimal.
Running mysql 5.0.24
Thanks in advance,
Ray