Example Number 3.4

Example Name: SearchProducts.asr

Language: ServerSide ActionScript

Version: 1.0.0

Code:

function getSearchResult(search) {
  var theSql = "SELECT ProductName, UnitPrice, QuantityPerUnit"; 
  theSql += " FROM Products";
  if(search) {
    theSql += " WHERE ProductName LIKE ";
    theSql += "'%" + search + "%'";
  }
  return CF.query({datasource:"Northwind", sql:theSql});
}

Download code text

Download chapter example files