Yes, call Query.getSQL() (and Query.getBindValues()) to extract this
information:

https://www.jooq.org/javadoc/latest/org/jooq/Query.html#getSQL--
https://www.jooq.org/javadoc/latest/org/jooq/Query.html#getBindValues--

Thanks,
Lukas

2018-02-27 22:10 GMT+01:00 Kirusanth Poopalasingam <[email protected]>:

>
> Hi Lukas,
>
> Is there a way to get the insert statement as String than executing it?
>
> Something like this would be nice:
>
> Result<EventLogRecord> result = dslContext.selectFrom(Tables.T_EVENT_LOG)
>     .fetch();
>
> EventLogRecord eventLogRecord = result.get(0);
> // I can do this
> eventLogRecord.insert();
>
> // but I'm only interested in the sql statement
> String sqlInsert = eventLogRecord.insertAsSql();
>
>
>
> Thanks,
> Kiru
>
> --
> 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