Versions Compared

Key

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

...

Parameter
  1. SQL statement string
    1. The SQL statement must be valid for the database you are connecting to

Return Value

This method will return a handle which much be used again in other statements.

...

Code Block
languagejavascript
var table = "productsp";
 
pjs.define("productsp_out", { type: 'data structure', qualified: true, dim: 50, extName: table  });
pjs.define("searchQuery", { type: "char", length: 30 });
 
pjs.clear(productsp_out);

searchQuery = '%' + 'Garmin' + '%';
var c1 = pjs.prepare("SELECT * FROM productsp WHERE prdesc LIKE ? ORDER BY prid");
c1.bindParameters(searchQuery.trim());
c1.execute();
 
pjs.fetch(c1, productsp_out, 50);
 
c1.close();


Requirements

This When using an IBM i database, this API requires the Profound.js Connector module.