我正在使用简单的代码在 Firebird 库“node-firebird”中按顺序进行测试。 它总是返回 1 行,但应该有很多。
exports.sequentially = (select, db_con_options) => {
Firebird.attach(db_con_options, (err, db) => {
if (err)
console.log(err);
db.sequentially(select, function(row, index) {
console.log(row);
}, function(err) {
console.log(err);
db.detach();
});
});}
我什至在 Stack Overflow 上找到了示例,它看起来是一样的。有什么建议么? 它是如何工作的?
最佳答案
解决方案:
依次有第 3 个参数“next”,在你调用它之后,你的 sql 语句将转到下一行。这是一个例子:
db.sequentially( select, (row, index, next) => {
console.log(row);
next();
}
关于javascript - Node Firebird 顺序选择不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51875145/