Class: ResultSet

new ResultSet()

A $.hdb.ResultSet object can contain multiple rows. Individual row objects can be accessed via index. Then their values on the respective columns can be further accessed either by column name or index.

Example

var connection = $.hdb.getConnection();
var result = connection.executeQuery('SELECT FLAVOR, PRICE, QUANTITY FROM "DB_EXAMPLE"."ICECREAM"');
// result can be accessed as if it were a JSON array with a structure similar to [{FLAVOR:"CHOCOLATE", PRICE:9.50, QUANTITY:2},{FLAVOR:"LEMON", PRICE:9.99, QUANTITY:8}]
// get the first row of the result set
var row = result[0];
// get the value of a column in the row
var flavor = row['FLAVOR'];
// var flavor = row.FLAVOR;
// var flavor = row[0];
// cycles through each row of the Result Set and gets the value of a specific column.
var flavors;
for (var row in result) {
flavors += result[row]['FLAVOR'] + ' ';
}
$.response.setBody(JSON.stringify(result));