meteor-mssql
meteor-mssql copied to clipboard
How to handle output parameters from stored procedures
I'd like to execute a stored procedure like this:
var opts = {
sp : "procedureName",
inputs : [
{ name: 'param1', type: Sql.driver.Int, value: 0 }
],
outputs : {
outputParam : Sql.driver.VarChar,
}
};
Sql.sp(opts,function (err,res) {
// handle response
});
But I haven't found a way to access the output parameters from there. (Is there one that I've missed?)
I've figured out that the parameter would be available in request.parameters.outputParam, but the request object is never exposed from within Sql.sp().
If the request object would've been returned from Sql.sp() the following code would be possible:
var request = Sql.sp(opts,function (err,res) {
// handle response
request.parameters.outputParam.value;
});
Have I missed something here, else I'll submit a pull request?
This is almost certainly a bug. I'll take a pull request.