Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Counting .executeBatch();  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I count the inserted records


[ April 11, 2008: Message edited by: Fred Rosenberger ]
 
Campbell Ritchie
Marshal
Posts: 55677
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . by adding count++; as a line in your for-loop?
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
. . . by adding count++; as a line in your for-loop?


Thanks a lot
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or look at the return value of executeBatch. That's an int[]:
an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.

Just add those values and you should get the answer as well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!