Iterating Over the Records of a Database Table

Instead of fetching a set of records from a table as a list, it is possible to get a record iterator that will iterate through a set of records one at a time. One way to do this is by first setting the useRecordIterator property of a table. Another is by requesting an iterator directly:

set memberIterator to iterate over the records of memberTable

The next record can then be obtained using the nextValue property of the iterator:

put memberIterator's nextValue into currentMember

Treating the iterator as a list (such as by using the as a list operator) causes it to fetch all of the remaining records.

A record iterator might be convenient in some situations, however it only provides a very small performance advantage, as all of the data is fetched from the database at once but only converted to record objects as requested.


This topic was last updated on June 21, 2019, at 02:49:49 PM.

Eggplant icon | Documentation Home | User Forums | Support | Copyright © 2019 Eggplant