Versions Compared

Key

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

...

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

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

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

pjsc1.close(c1);