How do you batch insert and still obtain identity?

View: New views
1 Messages — Rating Filter:   Alert me  

How do you batch insert and still obtain identity?

by Robert Nicholson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc