Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert sys_guid generated value via jooq DSL

I need help with jooq DSL. How can be written in jooq DSL insert like this one: insert into t (c) values (sys_guid()); ? For oracle. Thanks

like image 795
t0ki Avatar asked Dec 20 '25 09:12

t0ki


1 Answers

Whenever you're missing a feature / support for a vendor-specific expression in jOOQ, plain SQL templating is your help: https://www.jooq.org/doc/latest/manual/sql-building/plain-sql-templating

In your case, write:

DSL.using(configuration)
   .insertInto(T)
   .columns(T.C)
   .values(field("sys_guid()", T.C.getDataType()));
like image 67
Lukas Eder Avatar answered Dec 21 '25 23:12

Lukas Eder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!