DataIterator
In this example, the function code gets a page at a time. It counts total items and iterates until the last page is fetched.
Code: /lessons/DataIterator
DataIterator lets the function iterate through each record without having to deal with the next page fetch logic.
Steps
Create a new function called DataIteratorLesson.java.
Create a DataIterator instance using the SQL template used in the previous lesson.
It will internally create a DataRequest object.
Set passed parameters into DataRequest of DataIterator.
Initialize the DataIterator.
Iterate through it until there are no more items.
Execute the function and examine the result.
Last updated