## Not run:
# result=NA
# indices = 1:10000
#
# #run a query on each batch of indexes, appending each result to
# # "result" as we go.
# batchByIndex(indices, function(indexBatch){
# df = dbGetQuery(dbConnection, generateQuery(indexBatch))
# result <<- if(is.na(result)) df else rbind(result,df)
# },1000)
# ## End(Not run)
Run the code above in your browser using DataLab