I have a query like this:
Result<?> result = create.select(CONSUMER.CONS_ID_NO,
CONSUMER.CONS_NAME,
concat(CONSUMER.AREA_CODE, "/", CONSUMER.CONS_NO, "/", CONSUMER.CAT_CODE).as("ConsNo"),
CONSUMER.ARREARS)
.from(CONSUMER)
.fetch();
I wrote this according to the JOOQ Manual, but I am getting an error that says:
The method concat(String...) in the type Factory is not applicable for the arguments (TableField, String, TableField, String, TableField)
I am using JOOQ-3.
It seems that the sample in the manual doesn't work. However, you can convert a string to Filed via org.jooq.impl.Factory.val
.
Record result = create.select(
concat(AUTHOR.FIRST_NAME, val(" "), AUTHOR.LAST_NAME).as("Full Name")
).from(AUTHOR).fetchAny();
Please refer to this email from Lukas Eder for details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With