Nagaraju Nooka
Nagaraju Nooka

Reputation: 149

How TO Get Last Inserted ROW SQL (Not ID) Jooq

I am using jOOQ as SQL generator. I could see I am able to get last inserted row using DSLContext.lastID(). But how do I get underlying db sql string.

ex: For Sqlite SELECT last_insert_rowid()

Upvotes: 1

Views: 870

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 221145

There isn't any such specific query that you can get from the jOOQ API, short of constructing it yourself, e.g. by using plain SQL:

DSL.using(configuration)
   .select(field("last_insert_rowid()", SQLDataType.INTEGER));

Upvotes: 2

Related Questions