How do you batch insert and still obtain identity?
How do you batch insert and still obtain identity?
От:
Robert Nicholson <robert.nicholson@gmail.com>
Дата:
So, when you make use of Serial, or Autoincrement fields how is it possible to insert in a batch update and then learn the identity of the rows you should inserted? Is it my understanding that when you want to do bulk inserts thru batch update that you are required to provide the primary keys having called a sequence or obtained them before hand since there's no way int he result of an update to obtain the identity of the rows you've just inserted. It is puzzling to me that JDBC doesn't allow you to do this given that it can tell you which statement (by index) succeeded or failed.