When you're missing support for a vendor-specific function in jOOQ, the
easiest way to go forward is by using "plain SQL"
http://www.jooq.org/doc/latest/manual/sql-building/plain-sql

In your case, the following code will help:

public class MyDSL {
    public static <T> Field<T> values(Field<T> field) {
        return DSL.field("values({0})", field.getDataType(), field);
    }
}

You can now use the above VALUES clause in your INSERT .. ON DUPLICATE KEY
UPDATE statements.

See also:
https://github.com/jOOQ/jOOQ/issues/2134

Hope this helps,
Lukas

2015-06-13 13:05 GMT+02:00 jdoe <[email protected]>:

> How do I reference VALUES in ON DUPLICATE KEY UPDATE?
>
> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)
>   ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);
>
>
> More about it:
> http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html#function_values
> .
>
> --
> 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.

Reply via email to