Logical Conditions Oracle Fusion Middleware Online Documentation Library

Conditions 6-5 Table 6–4 shows the result of applying the NOT condition to an expression. Table 6–5 shows the results of combining the AND condition to two expressions. For example, in the WHERE clause of the following SELECT statement, the AND logical condition returns values only when both product.levelx is BRAND and v1.prodkey equals product.prodkey: view id=v2 schema=region, dollars, month_[CDATA[ select v1.region, v1.dollars, v1.month_ from v1, product where product.levelx = BRAND and v1.prodkey = product.prodkey ]]view Table 6–6 shows the results of applying OR to two expressions. For example, the following query returns the internal account identifier for RBK or RBR accounts with a risk of type 2: view id=ValidAccounts schema=ACCT_INTRL_ID[CDATA[ select ACCT_INTRL_ID from Acct where MANTAS_ACCT_BUS_TYPE_CD = RBK OR MANTAS_ACCT_BUS_TYPE_CD = RBR AND ACCT_EFCTV_RISK_NB = 2 ]]view Table 6–7 shows the results of applying XOR to two expressions. Table 6–4 NOT Truth Table -- TRUE FALSE UNKNOWN NOT FALSE TRUE UNKNOWN Table 6–5 AND Truth Table AND TRUE FALSE UNKNOWN TRUE TRUE FALSE UNKNOWN FALSE FALSE FALSE FALSE UNKNOWN UNKNOWN FALSE UNKNOWN Table 6–6 OR Truth Table OR TRUE FALSE UNKNOWN TRUE TRUE TRUE TRUE FALSE TRUE FALSE UNKNOWN UNKNOWN TRUE UNKNOWN UNKNOWN 6-6 Oracle Complex Event Processing CQL Language Reference For example, the following query returns c1 and c2 when c1 is 15 and c2 is 0.14 or when c1 is 20 and c2 is 100.1, but not both: query id=q6[CDATA[ select S2.c1, S3.c2 from S2[range 1000], S3[range 1000] where S2.c1 = 15 and S3.c2 = 0.14 xor S2.c1 = 20 and S3.c2 = 100.1 ]]query

6.4 LIKE Condition

The LIKE condition specifies a test involving regular expression pattern matching. Whereas the equality operator = exactly matches one character value to another, the LIKE conditions match a portion of one character value to another by searching the first value for the regular expression pattern specified by the second. LIKE calculates strings using characters as defined by the input character set. like_condition::= arith_expr::= on page 5-6, const_string::= on page 7-12 In this syntax: ■ arith_expr is an arithmetic expression whose value is compared to const_ string . ■ const_string is a constant value regular expression to be compared against the arith_expr . If any of arith_expr or const_string is null, then the result is unknown. The const_string can contain any of the regular expression assertions and quantifiers that java.util.regex supports: that is, a regular expression that is specified in string form in a syntax similar to that used by Perl. Table 6–8 describes the LIKE conditions. Table 6–7 XOR Truth Table XOR TRUE FALSE UNKNOWN TRUE FALSE TRUE UNKNOWN FALSE TRUE FALSE UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN Conditions 6-7 For more information on Perl regular expressions, see http:perldoc.perl.orgperlre.html .

6.4.1 Examples

This condition is true for all last_name values beginning with Ma: last_name LIKE Ma All of these last_name values make the condition true: Mallin, Markle, Marlow, Marvins, Marvis, Matos Case is significant, so last_name values beginning with MA, ma, and mA make the condition false. Consider this condition: last_name LIKE SMITH[A-Za-z] This condition is true for these last_name values: SMITHE, SMITHY, SMITHS This condition is false for SMITH because the [A-Z] must match exactly one character of the last_name value. Consider this condition: last_name LIKE SMITH[A-Z]+ This condition is false for SMITH but true for these last_name values because the [A-Z]+ must match 1 or more such characters at the end of the word. SMITHSTONIAN, SMITHY, SMITHS For more information, see http:java.sun.comj2se1.5.0docsapijavautilregexPattern. html .

6.5 Range Conditions

A range condition tests for inclusion in a range. Table 6–8 LIKE Conditions