fetchBatched function

Run a batched query