Previous Topic: ParametersNext Topic: Expansion of db-record-field


Usage

Order of Evaluation

When CA IDMS/DB encounters a boolean expression, it evaluates all operators in the entire boolean expression. Operators are evaluated one at a time, beginning with the operator of the highest precedence. Operators in arithmetic expressions are assigned the highest precedence, followed by comparison operators and boolean operators, respectively. The default order of precedence is shown following:

  1. Unary minus in an arithmetic expression (highest precedence)
  2. Multiplication and division in an arithmetic expression
  3. Addition and subtraction in an arithmetic expression
  4. MATCHES and CONTAINS comparison operators
  5. EQ, NE, GT, LT, GE, LE comparison operators
  6. NOT boolean operator
  7. AND boolean operator
  8. OR boolean operator (lowest precedence)

Operations of equal precedence are evaluated left to right.

Use Parentheses to Override Default Precedence of Operators

You can use parentheses to override the default precedence of operators and to clarify multiple-comparison boolean expressions. The expression in the innermost parentheses is evaluated first. The keyword NOT can precede a parenthetical expression to negate the result.