Versions Compared

Key

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

...

Code Block
languagejavascript
  pjs.define("prid", { type: "packed decimal", length: 5, decimals: 0, initValue: 105 });
  pjs.define("prname", { type: "char", length: 30 });
  pjs.define("prdesc", { type: "char", length: 60 });

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

  if (SQLSTATE == '00000') {
    pjs.fetch(c1, prid, prname, prdesc);
    while (SQLSTATE == '00000') {
      //Do work with variables here..
      pjs.fetch(c1, prid, prname, prdesc);
    }
  }
  pjs.close(c1);


  pjs.disconnect();