Issue with data update to the correct record

Thanks for the advice. I placed the bulkUpdate in a do while loop to check if there is hasNext() in the collection so that I can call bulkUpdate again if hasNext() is true but the bulkUpdate results are not updating all the rows correctly with the updated data.

So it seems like I cannot put the bulkUpdate in any kinds of loop.