Versions Compared

Key

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

...

Code Block
languagejs
titleCompare pjs.query and pjs.data.get
// These 2 lines will return the exact same results
let rcds1 = pjs.query("select * from customers");
let rcds2 = pjs.data.get("customers");


// Here you can see some differences on how to get records with criteria.  Both will return the exact same result.
const parm1 = "USA";
const strName = "B"

let rcds3 = pjs.query("select * from customers where country = ? and customerName > ?", [parm1, strName]);

let filter = [
	pjs.data.createCondition("country", "=", parm1),
	pjs.data.createCondition("customerName", "=>", strName)
];
let rcds4 = pjs.data.get("customers", filter);

...