Closed Arthesian closed 4 years ago
Or, to prevent a breaking change you could do something like this:
storedProc(inputParams, (error, outputScalar, results, ...other) => {
if (error) {
reject(error);
} else {
resolve({
outputScalar: outputScalar,
results: results,
other: other
});
}
});
Actually I already have a little better version of this module used in other projects directly where I use the ...results approach. This weekend I'll sync the newer version into this standalone module. You see this newer version as part of the openSAP course materials here: https://github.com/SAP/hana-xsa-opensap-hana7/blob/hana2_sps04_scp/srv/utils/dbPromises.js#L47
Ah okay. Cool. Thanks for the update!
Hi,
I'm using your package for a NodeJS API connecting to a HANA DB.
The only issue i'm experiencing so far is that when a Procedure returns mutliple output variables, only the first one is returned.
The issue lies with the callback method here: https://github.com/jungsap/sap-hdbext-promisfied/blob/master/index.js#L29
It probably should be something like:
This way multiple output variables can be captured in an array - and everything is returned properly.
Thanks