new ProcedureResult()
The $.hdb.ProcedureResult object contains the output parameters and $.hdb.ResultSet objects returned by a procedure call. Output parameters can be accessed by their name. The $.hdb.ResultSet objects are stored in an array under the $resultSets property.
Example
// Assuming procedure with signature 'DB_EXAMPLE'.icecream.shop::sell(IN flavor VARCHAR, IN quantity INTEGER, IN payment DECIMAL, OUT change DECIMAL)
var fnSell = connection.loadProcedure('DB_EXAMPLE', 'icecream.shop::sell');
var result = fnSell('CHOCOLATE', 3, 30.0);
// result can be accessed as if it were a JSON object with a structure similar to {change: 1.50, $resultSets:[....]}
// value of output parameter 'change'
var change = result['change'];
// array of $.hdb.ResultSet returned by the stored procedure
var resultSets = result['$resultSets'];
// iterate over all output parameters. Note: $resultSets is not enumerable, so it won`t show up in a for-each loop.
var params;
for (var outputParam in result) {
params += outputParam + ' ';
}
Members
-
$resultSets :Array.<$.hdb.ResultSet>
-
An array containing all of the result sets returned by the stored procedure.
Type:
- Array.<$.hdb.ResultSet>