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 5 Next »

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

var c1 = pjs.allocStmt();
pjs.executeDirect(c1, "select prid, prname, prdesc from demolib/productsp order by prid");

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

pjs.close(c1);

  • No labels