What count does insertInto()...execute() return when using onDuplicateKeyUpdate() ?

3 views
Skip to first unread message

Paul Hamer

unread,
Oct 3, 2017, 5:16:50 AM10/3/17
to jOOQ User Group
Hi,

I'm using the following construct:

int count = dsl.insertInto(...)
   
.set(...)
   
.set(...)
   
.onDuplicateKeyUpdate()
   
.set(...)
   
.execute();

My question is, what will "count" contain? The number of added rows, or the number of updated rows? Or perhaps the sum of both? I can't seem to find it in the documentation.

Kind regards,
Paul

Paul Hamer

unread,
Oct 3, 2017, 5:20:08 AM10/3/17
to jOOQ User Group
LOL, I just read the execute() javadoc again and found:

Merge : the result may have no meaning

Guess that answers my question ;-)
I missed it before, because I did not trigger on "merge".

Regards,
Paul
Reply all
Reply to author
Forward
0 new messages