Oracle 11g problem with offset/limit

307 views
Skip to first unread message

andrew...@gmail.com

unread,
Aug 8, 2018, 3:05:15 AM8/8/18
to jOOQ User Group
jOOQ version 3.10.5

I developing against an Oracle 12c DB but deploying to an 11g. 

I don't think it matters but the code generation was done against the 12c.

In my jOOQ query, I have .offset(...) and .limit(...).

When I run against the 11g DB, jOOQ sometimes generates the proper rownum format for emulating the offset and limit.

Sometimes, however, it generates the offset 0 rows fetch next ? rows only form.

Is there a way to specify the Oracle version or to specify the form of the offset/limit generation?

Thanks
Andrew

Lukas Eder

unread,
Aug 8, 2018, 4:05:37 AM8/8/18
to jooq...@googlegroups.com
Hi Andrew,

Thank you very much for your message. It does not matter what version you ran the code generator with. However, in order to make sure that on 11g you're getting appropriate ROWNUM filtering for .offset() and .limit(), make sure you always use SQLDialect.ORACLE11G in your Configuration. Both SQLDialect.ORACLE and SQLDialect.ORACLE12C will generate the new row_limiting_clause. If you auto-discover the SQLDialect with a 12c JDBC Connection, then it will also be mapped to ORACLE12C.

I hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Geery

unread,
Aug 8, 2018, 4:53:03 AM8/8/18
to jooq...@googlegroups.com
Setting the Oracle dialect explicitly to 11g solved the problem.

Thanks!
Andrew

You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/EW_IFfGf5CY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages