jOOQ calls this a bulk insert, not a batch insert. Just append a RETURNING
clause and you're all set (if your underlying RDBMS supports this, that is):
https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/insert-statement/insert-returning/

On Wed, Dec 14, 2022 at 10:37 AM akash verma <akka9...@gmail.com> wrote:

>  Hey Lukas,
>
> I just wanted to know is there any ways to get the generated IDs when we
> batch insert, does JOOQ provide any methods for the same.
>
> I try to use valuesOfRecords() but it is not working.
>
> List<Record3<Integer, String, String>> records = ...
> create.insertInto(AUTHOR,
> AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
> .valuesOfRecords(records)
> .execute();
>
>
> --
> 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 jooq-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/c01ec364-0d1f-4afb-93df-f33a378a8995n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/c01ec364-0d1f-4afb-93df-f33a378a8995n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO54Gad8-FiJwVY5EAsvc3EgT9Av%2BYw0BA_WGG4JF9X4kA%40mail.gmail.com.

Reply via email to