Hi Ugo, In tables where I have used an auto generated ID, the latest ID is always the highest number. So I use SELECT max(ID) FROM <filename>. There may be a better way to do it, but this works fine for me.
Noel On Tuesday, August 7, 2012 3:41:48 AM UTC+10, Ugo Matrangolo wrote: > > Hi, > > I need to know the auto generated ID of the last entity that was just > persisted on the db using an INSERT operation. > > On PostGRES I was used to the `... returning id` statement at the end of > the INSERT operation. This seems to be missing from H2. > > How can I get the same behavior ??? > > Cheers, > Ugo. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/6XUyWiID7rAJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
