Versions Compared

Key

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

...

Code Block
languagejavascript
  pjs.connect("*LOCAL");
 
  var c1 = pjs.allocStmt();
  pjsc1.executeDirect(c1, "selectSELECT prid, prname, prdesc fromFROM demolib/productsp orderORDER byBY prid", "c1");

  var obj;



if (SQLSTATE == '00000') {

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

   }

  }

  pjsc1.close(c1);


 
pjs.disconnect()