I am very new to JOOQ. Can you please suggest how to use it in update
statements. I tried out something like this but not working for me.
Field<CustomTypeRecord> f = DSL.val(new CustomTypeRecord("test3", "-1"));
dslContext.update()
.set( Tables.MY_TABLE.CUSTOMTYPE,
DSL.field("array_remove({0}, {1})", f.getDataType(),
Tables.MY_TABLE.CUSTOMTYPE, f))
.where(condition)
.execute();
On Friday, February 3, 2023 at 2:03:46 PM UTC+5:30 [email protected] wrote:
> ARRAY_REMOVE will be supported in the upcoming jOOQ 3.18:
> https://github.com/jOOQ/jOOQ/issues/11981
>
> Until then, you can just use plain SQL templating whenever you need to
> work with vendor specific functions that aren't supported:
> https://www.jooq.org/doc/latest/manual/sql-building/plain-sql-templating/
>
> Field<CustomTypeRecord> f = DSL.val(new CustomTypeRecord("test3", "-1"));
> DSL.field("array_remove({0}, {1})", f.getDataType(),
> MY_TABLE.CUSTOMTYPECOLUMN, f);
>
>
> I hope this helps,
> Lukas
>
> On Fri, Feb 3, 2023 at 9:30 AM Pragya Gaur <[email protected]> wrote:
>
>> I have a TYPE defined say customtype and have a table where one of the
>> columns is customtype[].
>> I am trying to find ways where I can execute the below sql query in JOOQ:
>>
>> update MY_TABLE SET customtypecolumn = array_remove(customtypecolumn,
>> ('test3','-1')::customtypecolumn) where <some_condition>
>>
>> I tried following this link
>> https://jooq-user.narkive.com/ScEfUAlX/fastest-way-to-remove-values-from-an-integer-array
>> But this way I am getting exception TYPE customtype is not supported in
>> dialect POSTGRES
>>
>> --
>> 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].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jooq-user/78e86317-41d1-41ed-ba6d-f2060ac3018an%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/jooq-user/78e86317-41d1-41ed-ba6d-f2060ac3018an%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/2fcbcc56-c404-4b5e-b765-fad5a6757c04n%40googlegroups.com.