Hi, I'm just going to assume this is about PostgreSQL.
While the jOOQ code generator supports array types, we currently don't have explicit support for many functions that take array arguments. You can, however, generate the pg_catalog functions and use those directly, or you can resort to plain SQL and remove values from your arrays that way. The function you're looking for is called array_remove(): http://www.postgresql.org/docs/9.3/static/functions-array.html As in: DSL.update(MY_TABLE) .set(MY_TABLE.FILE_IDS, DSL.field("array_remove({0}, {1})", MY_TABLE.FILE_IDS.getDataType(), MY_TABLE.FILE_IDS, val(7))) .execute(); // And then DSL.delete(MY_TABLE) .where("array_length({0}, 1) = 0", MY_TABLE.FILE_IDS) .execute(); Of course, if you had normalised your schema, the deletion would be much simpler Hope this helps, Lukas 2014-11-04 22:00 GMT+01:00 <[email protected]>: > Hi, > > i have a file-table in my DB with an "ID" as primary key and a second > entry "file_ids" which is an integer array and a third entry "w_id" > > for example: > > ID file_ids w_id > > 1 [3,6,7] 100 > 2 [1,7,2] 100 > > now i want update alle file_id arrays where the w_id is 100 and i want > delete a number for example 7 in alle arrays. > > what is the fastest way to do this with jooq? > > can i search for number 7 and delete it directly with jooq ? > > after this operation the table should look like this: > > ID file_ids w_id > > 1 [3,6] 100 > 2 [1,2] 100 > > Best regards > > > > > -- > 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.
