MySQL Forums
Forum List  »  Stored Procedures

Re: Multipline lines insert in a table with Autoincrement field
Posted by: Peter Brawley
Date: March 02, 2013 03:45AM

drop table if exists t;
create table t(id smallint unsigned primary key auto_increment);
insert into t values(null),(null),(null);
select last_insert_id();
+------------------+
| last_insert_id() |
+------------------+
|                1 |
+------------------+

Is your loop executing twice? Is it doing one insert at a time?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Multipline lines insert in a table with Autoincrement field
1017
March 02, 2013 03:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.