Using ELEMENT_TIME With PATTERN

4 Operators 4-1 4 Operators An operator manipulates data items and returns a result. Syntactically, an operator appears before or after an operand or between two operands.

4.1 Introduction to Operators

Operators manipulate individual data items called operands or arguments. Operators are represented by special characters or by keywords. For example, the multiplication operator is represented by an asterisk . Oracle CQL provides the following operators: ■ Arithmetic Operators on page 4-3 ■ Concatenation Operator on page 4-4 ■ Alternation Operator on page 4-5 ■ Range-Based Stream-to-Relation Window Operators on page 4-6 ■ Tuple-Based Stream-to-Relation Window Operators on page 4-13 ■ Partitioned Stream-to-Relation Window Operators on page 4-18 ■ IStream Relation-to-Stream Operator on page 4-24 ■ DStream Relation-to-Stream Operator on page 4-25 ■ RStream Relation-to-Stream Operator on page 4-26

4.1.1 What You May Need to Know About Unary and Binary Operators

The two general classes of operators are: ■ unary : A unary operator operates on only one operand. A unary operator typically appears with its operand in this format: operator operand ■ binary : A binary operator operates on two operands. A binary operator appears with its operands in this format: operand1 operator operand2 Other operators with special formats accept more than two operands. If an operator is given a null operand, then the result is always null. The only operator that does not follow this rule is concatenation ||. 4-2 Oracle Complex Event Processing CQL Language Reference

4.1.2 What You May Need to Know About Operator Precedence

Precedence is the order in which Oracle CEP evaluates different operators in the same expression. When evaluating an expression containing multiple operators, Oracle CEP evaluates operators with higher precedence before evaluating those with lower precedence. Oracle CEP evaluates operators with equal precedence from left to right within an expression. Table 4–1 lists the levels of precedence among Oracle CQL operators from high to low. Operators listed on the same line have the same precedence. Precedence Example In the following expression, multiplication has a higher precedence than addition, so Oracle first multiplies 2 by 3 and then adds the result to 1. 1+23 You can use parentheses in an expression to override operator precedence. Oracle evaluates expressions inside parentheses before evaluating those outside. Table 4–1 Oracle CQL Operator Precedence Operator Operation +, - as unary operators Identity, negation , Multiplication, division +, - as binary operators, || Addition, subtraction, concatenation Oracle CQL conditions are evaluated after Oracle CQL operators See Chapter 6, Conditions