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

Version 1 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') {
    obj = pjs.fetch(c1, 50);

    while (SQLSTATE == '00000') {

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

  pjs.close(c1);


  pjs.disconnect()
  • No labels