简体   繁体   English

如何获取最后插入的ROW SQL(非ID)Jooq

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

I am using jOOQ as SQL generator. 我正在使用jOOQ作为SQL生成器。 I could see I am able to get last inserted row using DSLContext.lastID() . 我可以看到我能够使用DSLContext.lastID()获得最后插入的行。 But how do I get underlying db sql string. 但是,如何获取基础的db sql字符串。

ex: For Sqlite SELECT last_insert_rowid() 例如:对于Sqlite SELECT last_insert_rowid()

There isn't any such specific query that you can get from the jOOQ API, short of constructing it yourself, eg by using plain SQL: 您无法从jOOQ API中获得任何这样的特定查询,只需自己构造即可(例如,使用普通SQL):

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM