Having Clause Binary Clause

Oracle CQL Queries, Views, and Joins 18-13 TABLE getAllGeometriesspatial as validGeometries AS R2 ]]query For more examples, see: ■ Data Cartridge TABLE Query Example: Iterator on page 20-20 ■ Data Cartridge TABLE Query Example: Array on page 20-21 ■ Data Cartridge TABLE Query Example: Collection on page 20-22 For more information, see: ■ table_clause on page 20-10 ■ Section 18.7, Oracle CQL Queries and Oracle Data Cartridges ■ Section 1.1.11, Functions ■ Section 15.1.4.3, Arrays ■ Section 15.1.4.4, Collections

18.2.8 Cache Query

Using an Oracle CQL processor, you can specify a cache as an event source. You can query this event source and join it with other event sources using a Now window only. Oracle CEP cache event sources are pull data sources: that is, Oracle CEP polls the event source on arrival of an event on the data stream. For more information, see Section 18.5, Oracle CQL Queries and the Oracle CEP Server Cache .

18.2.9 Sorting Query Results

Use the ORDER BY clause to order the rows selected by a query. order_by_clause::= order_by_list::= on page 20-5 Sorting by position is useful in the following cases: ■ To order by a lengthy select list expression, you can specify its position in the ORDER BY clause rather than duplicate the entire expression. ■ For compound queries containing set operators UNION, INTERSECT, MINUS, or UNION ALL, the ORDER BY clause must specify positions or aliases rather than explicit expressions. Also, the ORDER BY clause can appear only in the last component query. The ORDER BY clause orders all rows returned by the entire compound query. The mechanism by which Oracle CEP sorts values for the ORDER BY clause is specified by your Java locale.

18.2.10 Detecting Differences in Query Results

Use the DIFFERENCE USING clause to succinctly detect differences in the IStream or DStream of a query. 18-14 Oracle Complex Event Processing CQL Language Reference using_clause::= usinglist::= on page 20-6 Consider the query that Example 18–9 shows. Example 18–9 DIFFERENCE USING Clause query id=q0 ISTREAM SELECT c1 FROM S [RANGE 1 NANOSECONDS] DIFFERENCE USING c1 query Table 18–1 shows sample input for this query. The Relation column shows the contents of the relation S [RANGE 1 NANOSECONDS] and the Output column shows the query results after the DIFFERENCE USING clause is applied. This clause allows you to succinctly detect only differences in the IStream output. When you specify the usinglist in the DIFFERENCE USING clause, you may specify columns by: ■ attribute name: use this option when you are selecting by attribute name. Example 18–10 shows attribute name c1 in the DIFFERENCE USING clause usinglist. ■ alias: use this option when you want to include the results of an expression where an alias is specified. Example 18–10 shows alias logval in the DIFFERENCE USING clause usinglist. Table 18–1 DIFFERENCE USING Clause Affect on IStream Input Relation Output 1000: +5 {5} +5 1000: +6 {5, 6} +6 1000: +7 {5, 6, 7} +7 1001: +5 {5, 6, 7, 5} 1001: +6 {5, 6, 7, 5, 6} 1001: +7 {5, 6, 7, 5, 6, 7} 1001: +8 {5, 6, 7, 5, 6, 7, 8} +8 1002: +5 {5, 6, 7, 5, 6, 7, 8, 5} 1003: -5 {5, 6, 7, 5, 6, 7, 8} 1003: -5 {5, 6, 7, 6, 7, 8} 1003: -5 {6, 7, 6, 7, 8} 1003: -6 {6, 7, 7, 8} 1003: -6 {7, 7, 8} 1003: -7 {7, 8} 1003: -7 {8} 1003: -8 {} 1004: +5 {5} +5