codeshare update query for loop is changed to update each record individually