N.B: One immediate workaround is to use Factory.param(name, type) or
Factory.field("?", type) for your bind values. See also this manual
page for more info:

http://www.jooq.org/manual/JOOQ/BindValues/

2012/2/10 Lukas Eder <[email protected]>:
> Hello Andrea,
>
> I'm terribly sorry for the delay. Somehow, your request got stuck in
> the Google Groups.
>
> In some dialects, null has to be inlined as a literal in some cases to
> create correct SQL. I can see how this can turn out to be wrong when
> using jOOQ as a SQL builder only, though. What database are you using?
>
> Cheers
> Lukas
>
> 2012/1/31 Andrea <[email protected]>:
>> Hi all.
>>
>> I'm using jOOQ as query builder for Spring, to build SQL string
>> [ generated with the getSQL() method ] with JdbcTemplate.
>> For example, insertions like this..
>>
>> q = jooq.create.insertInto(TABLE)
>>                                .set(WBS_NODE.ONE, oneValue)
>>                                .set(WBS_NODE.TWO, twoValue)
>>                                .set(WBS_NODE.THREE, threeValue);
>>
>> ..generate SQL like this:
>> " .. ("one", "two", "three") values (?, ?, ?) .. "
>>
>> The problem is that if the variable twoValue is null when the query is
>> created above, the SQL will be:
>> " .. ("one", "two", "three") values (?, null, ?) .. "
>>
>> This is a problem for me, I want ALWAY the "?."
>>
>> So, there's any way to avoid the "null optimization?"
>>
>>
>> P.S: there are other tricky optimizations in the generated SQL ??

Reply via email to