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

The following example selects records from a file 50 rows at a time, into a primitive object.

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

  var obj;

  if (SQLSTATE == '00000') {

    while (pjs.hasMoreRows(c1)) {
      obj = pjs.fetch(c1, 50);
      for (var i = 0; i < pjs.rowCount(c1); i++) {
        console.log(obj[i]);
      }
    }

  }

  pjs.close(c1);


  pjs.disconnect()
  • No labels