1

I'm using simple code to test sequentially in Firebird lib "node-firebird". It always gives me back 1 row, but should be a lot of them.

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();
});
});}

I found example even here on Stack Overflow and it looks like the same. Any suggestions? How does it work?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Can you post a full [mcve]? – Mark Rotteveel Aug 16 '18 at 11:07
  • https://stackoverflow.com/questions/32911645/node-firebird-sequentially-select?rq=1 – Sebastian Zalewski Aug 16 '18 at 13:44
  • I want to edit last comment but tbh i can't see option for this, I found out a solution inside this function in lib. There is 3rd param "nextrow" after "index" , after i call nextrow() , func automaticaly step into next row. – Sebastian Zalewski Aug 16 '18 at 14:00
  • You can only edit comments for five minutes after posting, after that they are locked. You may want to consider posting a full answer with the solution to your problem if you found it yourself: it maybe helpful to others as well. – Mark Rotteveel Aug 16 '18 at 14:25
  • what is `select` value ? The best documentation are the unit test scripts of node-firebird, they enlist the use cases Henri (author of Node-Firebird) intended to put into the library, so read those tests and pick the examples most fitting your task – Arioch 'The Aug 16 '18 at 21:28
  • Select is ok , im always testing my sql results in db tools. Problem solved , thx for suggestions. – Sebastian Zalewski Aug 17 '18 at 08:41

1 Answers1

3

SOLUTION:

sequentially have 3rd parameter "next" , after u call it out, ur sql statement will go to next row. Here is an example :

db.sequentially( select, (row, index, next) => {
console.log(row);
next();
}