Hi James,

The set() method is overloaded. You already called the version that accepts
a bind variable (e.g. "bob"). But there's also an overload that accepts an
arbitrary column expression (Field<T>). Most of these functions are
available from org.jooq.impl.DSL. If a function is not available, like
clock_timestamp(), you can easily use plain SQL templating to make your own:
https://www.jooq.org/doc/latest/manual/sql-building/plain-sql-templating

DSL.field("clock_timestamp()", SQLDataType.TIMESTAMP);


I hope this helps,
Lukas

On Thu, Aug 30, 2018 at 4:57 PM <[email protected]> wrote:

>
> Hi,
>
> Id like to write an update query like this:
>
> update responses set response = ?, response_timestamp = clock_timestamp()
> where session_id = ?
>
> but I cannot quite get the syntax correct...
>
> I'm using:
>
> update(Tables.RESPONSES).set(Tables.RESPONSES.RESPONSE,
> "bob").set(Table.RESPONSES.RESPONSE_TIMESTAMP, ???No
> Idea??).where(Tables.RESPONSES.SESSION_ID.eq("sid").execute()
>
> ... what should the seconds set() clause look like?
>
> Thanks for any help!
>
> James
>
> --
> 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