Versions Compared

Key

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

...

Code Block
languagejavascript
var table = "productsp";
 
pjs.define("productsp_out", { type: 'data structure', qualified: true, dim: 50, elements: {
  "prid": { type: "packed decimal", length: 5, decimals: 0, initValue: 105 },
  "prname": { type: "char", length: 30 },
  "prdesc": { type: "char", length: 60 }
}})
 extName: table  });
pjs.define("searchQuery", { type: "char", length: 30 });
 
var c1;
pjs.connect("*LOCAL");
pjs.clear(productsp_out);


searchQuery = '%' + 'Garmin' + '%';
c1 = pjs.prepare("select prid, prname, prdesc from demolib/productsp * from " + table  + " where prdesc like ? order by prid");
pjs.bindParameters(c1, [
  [searchQuery.trim(), pjs.SQL_PARAM_INPUT]
]);
pjs.execute(c1);
 
pjs.fetch(c1, productsp_out, 50);
 
pjs.close(c1);
pjs.disconnect();

...