All versions: 3.12 | Development versions: 3.13

Parameter name prefix

Available in ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

When choosing a ParameterType.NAMED to produce named parameters, the default is to use a colon as a prefix to the parameter name, for example:

-- NAMED
SELECT FIRST_NAME || :1 FROM AUTHOR WHERE ID = :x

Depending on how the named parameters are interpreted, this default is not optimal. A better character might be the $ sign, e.g. in PostgreSQL or R2DBC. For this, the renderNamedParamPrefix setting can be used:

Programmatic configuration

Settings settings = new Settings()
    .withRenderNamedParamPrefix("$"); // Defaults to ":"

XML configuration

<settings xmlns="http://www.jooq.org/xsd/jooq-runtime-3.12.0.xsd">
  <renderNamedParamPrefix>$</renderNamedParamPrefix>
</settings>
The jOOQ Logo