Hello,

Support for these various PostgreSQL array function is on the roadmap:
https://github.com/jOOQ/jOOQ/issues/996

I think I could implement that for jOOQ 3.2, finally.

In the mean time, you'll have to resort to plain SQL. You can write:

DSL.field("array_append({0}, {1})", arrayType, myVarcharArray, "someNewText");

Or wrapping the above in a generic method:

public static <T> Field<T[]> arrayAppend(Field<T[]> array, T value) {
  return DSL.field("array_append({0}, {1})", array.getDataType(), array, value);
}

Hope this helps
Lukas

2013/9/25 Andreas Leier <[email protected]>

> Hi there,
>
> I'm trying to translate followings sql query to jooq (Postgres 9.2):
>
> UPDATE mytableSET my_varchar_array = array_append(my_varchar_array, 
> 'someNewText')WHERE my_id=6372
>
> This is what i've got so far:
>
> createFactory()
> .update(MYTABLE)
> .set(MYTABLE.MY_VARCHAR_ARRAY, ))
> .where(MYTABLE.MY_ID.equal(6372))
> .execute();
>
>
> As you can see i don't have a clue what to write within ".set" except the
> tablename :(
> for those who don't know array_append, it adds a single element in an
> existing array.
> Hope someone can help??
>
> greetings
> Andy
>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to