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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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
Lukas :-)
One can add a semicolon to all queries using my approach :-)
It's not much different than using an extra (missing) parameter like 'withSemicolon'.
Rohit wants to use jOOQ as part of something bigger, so he can probably append a char at the adapter between his query runner and generated SQL string (I guess). Sometimes the simplest solution is the best one, ha :-)
Regards,
Witold Szczerba
Sometimes, the darkest place is under the candlestick, you know...
--