The ExecForIteration method

Use the ExecForIteration method of the Query object for queries that return a large result set that must be processed a row at a time.

After issuing the query with ExecForIteration, your application must call NextRow to access the individual rows in the result set. While your application is processing the rows returned by ExecForIteration, the connection to the database server cannot be used for another query. You can, however, free up the connection to the server by using the ITQuery::Finish method to finish query processing without retrieving all rows.

This method is the query-executing mechanism most similar to executing a select statement by using the DataBlade® API mi_exec() and mi_next_row calls. Also, this method does not enable nonsequential access to the rows.