Witold ;-)

That's certainly the easiest way when doing it for that one single query...
But I suspect that Rohit will want to add semicolons to all his queries

2015-03-15 22:11 GMT+01:00 Witold Szczerba <[email protected]>:

> Hi guys!
> I think Lukas is wrong. The easiest way to add a semicolon is just to...
> add it:
>
> String sql = DSL.using(myConfiguration)
>          .update(...)
>          .set(...)
>          .where(...)
>          .getSQL(ParamType.INLINED) + ';';
>
> Voilà! :-)
>
> Regards,
> Witold Szczerba
> 14 mar 2015 11:15 "Lukas Eder" <[email protected]> napisał(a):
>
> Hi Rohit,
>>
>> The *easiest* way would be to implement an ExecuteListener and hook into
>> the renderEnd() event, adding the semi-colon to your query:
>>
>> http://www.jooq.org/doc/latest/manual/sql-building/dsl-context/custom-execute-listeners/
>>
>> So, you'd have to setup your own DefaultConfiguration and pass it to
>> DSL.using:
>>
>> String sql = DSL.using(myConfiguration)
>>                 .update(...)
>>                 .set(...)
>>                 .where(...)
>>                 .getSQL(ParamType.INLINED);
>>
>> Note that once you're working with your own DefaultConfiguration, you
>> might as well add a Setting to enforce the inlining of bind variables:
>>
>> http://www.jooq.org/doc/latest/manual/sql-building/dsl-context/custom-settings/
>>
>> That can be achieved with the StatementType.STATIC_STATEMENT setting.
>>
>> Hope this helps,
>> Lukas
>>
>> 2015-03-13 23:48 GMT+01:00 Rohit <[email protected]>:
>>
>>> Hi,
>>> I am using jOOQ as a simple SQL builder for Postgres database with
>>> inline parameters:
>>>
>>> String sql = DSL.using(SQLDialect.POSTGRES)
>>>                  .update(MY_TABLE)
>>>                  .set(A, 1)
>>>                  .where(B.greaterThan(5))
>>>                  .getSQL(ParamType.INLINED);
>>>
>>> This returns: "update MY_TABLE set A = 1 where B > 5"
>>>
>>> Is there way to add a semicolon at the end in that result?
>>>
>>> Thanks for your help!
>>>
>>> - Rohit
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "jOOQ User Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to