Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note
titleContent Freeze

As of July 25th, 2023, there is a content freeze on this page.

This method indicates whether the end of data has been reached for the most recent fetch of a statement handle. It is the opposite of pjs.hasMoreRows().

...

Code Block
languagejavascript
titleSelect all rows from SYSTABLES
pjs.define("systables", { type: "data structure", qualified: true, dim: 100, elements: {
  "table_name": { type: "char", varying: true, length: 128},
  "table_text": { type: "char", varying: true, length: 50 }
}});
   
var stmt = pjs.allocStmt();
stmt.executeDirect("select table_name, table_text from qsys2/systables");
var total = 0;
while (!stmt.endOfData()) {
  pjs.fetch(stmt, systables, 100);
  for (var idx = 1; idx <= stmt.rowCount(); idx++) {
    console.log("(%d) %s %s", total + idx, systables[idx].table_name, systables[idx].table_text);
  }
  total += stmt.rowCount();    
}
stmt.close();

...


Requirements

When using an IBM i database, this API requires the Profound.js Connector module.