Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12

Parameter name prefix

Applies to ✅ 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:

Example configuration

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

Feedback

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

The jOOQ Logo