Available in versions: Dev (3.20) | Latest (3.19) | 3.18

Plain SQL raw templates

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The previous section about plain SQL templating showed examples of the useful plain SQL templating language. Sometimes, you want plain SQL to just be "raw," omitting any processing by jOOQ. In particular, this can be the case when your SQL contains jOOQ's placeholder tokens, such as { and }. In that case, you can use the DSL.raw(String) method to create a org.jooq.SQL type that isn't getting processed.

For example, when using Informix's native MULTISET value constructor support:

resultQuery(raw(
  "SELECT * FROM TABLE (MULTISET {1})"
));

In this case, you certainly don't want that {1} token to be processed as a placeholder.

You can also turn off the templating feature globally, using Settings.renderPlainSQLTemplatesAsRaw.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo