我正在尝试找出下面的代码有什么问题,我正在使用插件 Tedious (SQL Server)、sequelize 和 NodeJs:
exports.getCreditsGeneral = function(sgecode) {
return sequelize.query('[dbo].[SP_ListaCreditos](:sgecode1)',
{ replacements:{sgecode1: sgecode}})
.then(total => {
return total.length ? total : 0
})
}
有人可以帮我吗?
谢谢。
最佳答案
您缺少 exec 参数
exports.getCreditsGeneral = function(sgecode) {
return sequelize.query('exec [dbo].[SP_ListaCreditos](:sgecode1)',
{ replacements:{sgecode1: sgecode}})
.then(total => {
return total.length ? total : 0
})
}
关于node.js - NodeJS - Sequelize - 存储过程 - 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53285394/