CE_CALC evaluates an expression and then bound to a new column
Example:with_tax = CE_PROJECTION(:product, [“CIDâ€, “CNAMEâ€, “OIDâ€, “SALESâ€, CE_CALC('â€SALES†* :vat_rate', decimal(10,2)) AS “SALES_VATâ€], ''â€CNAME†= ':cname''');Is equivalent to
with_tax2 = SELECT cid, cname, oid, sales, sales * :vat_rate AS sales_vat FROM :productmWHERE cname = ':cname';
All columns used in CE_CALC have to be included in the projection list. Another frequent use of CE_CALC is computing row numbers.
CE_CALC('rownum()', integer) AS "RANK"