On the org.jooq.Query.getSQL(ParamType paramType)
method
Like ParamType.NAMED_OR_INLINED
, but printing ?
instead of the named parameter.
For example:
DSL.select(M3_PUSH.asterisk())
.from(M3_PUSH)
.where(M3_PUSH.PLATFORM.eq(param(String.class)).and(M3_PUSH.ALERTKEY.eq("TEST")))
.getSQL()
Generates:
select "m3_push".* from "m3_push" where ("m3_push"."platform" = ? and "m3_push"."alertKey" = ?)
Whereas I'd like to have the second bindable parameter to be fixed:
select "m3_push".* from "m3_push" where ("m3_push"."platform" = ? and "m3_push"."alertKey" = "TEST")
Indexed or inlined parameters can be controlled on several levels. The first two don't work for you because they act globally:
Settings.paramType
Query.getSQL(ParamType)
, which you triedDSL.inline()
. This is what you needSee also: https://www.jooq.org/doc/latest/manual/sql-building/bind-values/inlined-parameters