Rational Developer for System z

Operators in ESQL

This topic briefly describes the use of operators in the subset of ESQL that is supported by the service flow project tools.
Important: To fully understand a feature described in this topic, you should read the complete description of the feature in the documentation for WebSphere® Message Broker (see Reference works describing ESQL).

Simple comparison operators

Each of the simple comparison operators compares two operands and returns a boolean result. The two operands must belong to the same data type. If the operands are expressions then they must resolve to the same data type.

The following table shows the simple comparison operators:

Table 1. Simple comparison operators
Operator: Description:
exp1 > exp2 Evaluates whether exp1 is greater than exp2.
exp1 < exp2 Evaluates whether exp1 is less than exp2.
exp1 >=exp2 Evaluates whether exp1 is greater than or equal to exp2.
exp1 <= exp2 Evaluates whether exp1 is less than or equal to exp2.
exp1 = exp2 Evaluates whether exp1 equals exp2.
exp1 <> exp2 Evaluates whether exp1 is not equal to exp2.

Complex comparison operators

Currently the only supported complex comparison operators are IS NULL and IS NOT NULL.

Logical operators

Each of the logical operators evaluates one or two boolean operands and returns a boolean result. If the operands are expressions then they must resolve to boolean.

The following table shows the simple comparison operators:

Table 2. Simple comparison operators
Operator: Description:
NOT exp1 Returns the logical negation of exp1
exp1 AND exp2 Returns the logical AND of exp1 and exp2
exp1 OR exp2 Returns the logical OR of exp1 and exp2.

Numeric operators

Each of the numeric operators evaluates one or two operands and returns a numeric result. The operands must belong to a numeric data type or be NULL. If either operand is NULL then the result is NULL. If the operands are of different numeric data types then special rules for implicit casting apply.

Table 3. Simple comparison operators
Operator: Description:
-exp1 Negates exp1.
exp1 + exp2 Returns the sum of exp1 and exp2
exp1 - exp2 Returns the value of exp1 minus exp2.
exp1 * exp2 Returns the product or exp1 and exp2
exp1 / exp2 Returns the value of exp1 divided by exp2

String operators

A string operators evaluates two operands and returns a string result. The operands must belong to a string data type or be NULL. If either operand is NULL then the result is NULL.

Table 4. Numeric operators
Operator: Description:
exp1 || exp2 Returns the value of exp2 concatenated to exp1

Operator precedence rules

The order of precedence used in evaluating expressions containing more than one operator is:
  • Parentheses
  • Unary operators (- and NOT)
  • Multiplication and division
  • Concatenation
  • Addition and subtraction

Operators at the same level are evaluated left to right.

To make your ESQL expressions easier to comprehend, it is a good practice to use parentheses to indicate explicitly which operands are to be evaluated together.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)