new ResultSetIterator()
Example
var connection = $.hdb.getConnection();
var result = connection.executeQuery('SELECT FLAVOR, PRICE, QUANTITY FROM "DB_EXAMPLE"."ICECREAM"');
var iterator = result.getIterator();
var totalPrice = 0;
while(iterator.next()) {
var currentRow = iterator.value();
totalPrice += currentRow['PRICE'];
}
Methods
-
next() → {boolean}
-
Checks if the underlying $.hdb.ResultSet has more rows and sets the value of the iterator to the next row if it exists.
Returns:
True if the result set has more rows otherwise returns false.- Type
- boolean
-
value() → {object}
-
Returns the current row that the iterator's value is set to. Should always be called after a call to next();
Throws:
-
Throws an error if next() was not previously called or if there are no rows in the result set.
- Type
- $.hdb.SQLException
Returns:
An object representing the row of a $.hdb.ResultSet.- Type
- object
-