Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

The following example reads records from a table one at a time into a primitive JavaScript object:

var c1 = pjs.allocStmt();
pjs.executeDirect(c1, "SELECT prid, prname, prdesc FROM demolib/productsp ORDER BY prid");

if (SQLSTATE == '00000') {
 
  var obj = c1.fetch();
  while (c1.hasMoreRows()) {
    console.log(obj);
    obj = c1.fetch();
  }
 
}

c1.close();

  • No labels