WITHIN Clause Oracle Fusion Middleware Online Documentation Library
19.10 INCLUDE TIMER EVENTS Clause
Use this clause in conjunction with the DURATION clause for non-event detection queries. Typically, in most pattern match queries, a pattern match output is always triggered by an input event on the input stream over which pattern is being matched. The only exception is non-event detection queries where there could be an output triggered by a timer expiry event as opposed to an explicit input event on the input stream. pattern_inc_timer_evs_clause::= pattern_clause::= on page 19-11, pattern_skip_match_clause::= on page 19-19, pattern_ definition_clause::= on page 19-14, duration_clause::= on page 19-22, subset_clause::= on page 19-25 For more information, see Section 19.9, DURATION Clause .19.11 SUBSET Clause
Using this clause, you can group together one or more correlation variables that are defined in the DEFINE clause. You can use this named subset in the MEASURES and DEFINE clauses just like any other correlation variable. For example: SUBSET S1 = Z,X The right-hand side of the subset Z,X is a comma-separated list of one or more correlation variables as defined in the PATTERN clause. The left-hand side of the subset S1 is the union of the correlation variables on the right-hand side. You cannot include a subset variable in the right-hand side of a subset. subset_clause::= non_mt_subset_definition_list::= on page 19-25 non_mt_subset_definition_list::= subset_definition::= on page 19-25 subset_definition::= subset_name::= on page 19-26, non_mt_corr_list::= on page 19-26 19-26 Oracle Complex Event Processing CQL Language Reference subset_name::= const_string::= on page 7-12 non_mt_corr_list::= correlation_name::= on page 19-11 Consider the query q55 in Example 19–27 and the data stream S11 in Example 19–28 . Stream S11 has schema c1 integer, c2 integer. This example defines subsets S1 through S6. This query outputs a match if the c2 attribute values in the input stream form the shape of the English letter W. Now suppose we want to know the sum of the values of c2 for those tuples which form the incrementing arms of this W shape. The correlation variable X represents tuples that are part of the first incrementing arm and Z represent the tuples that are part of the second incrementing arm. So we need some way to group the tuples that match both. Such a requirement can be captured by defining a SUBSET clause as the example shows. Subset S4 is defined as X,Z. It refers to the tuples in the input stream that match either X or Z. This subset is used in the MEASURES clause statement sumS4.c2 as sumIncrArm. This computes the sum of the value of c2 attribute in the tuples that match either X or Z. A reference to S4.c2 in a DEFINE clause like S4.c2 = 10 will refer to the value of c2 in the latest among the last tuple that matched X and the last tuple that matched Z. Subset S6 is defined as Y. It refers to all the tuples that match correlation variable Y. The query returns the stream in Example 19–29 . Example 19–27 MATCH_RECOGNIZE with SUBSET Clause Query query id=q55[CDATA[ select T.firstW, T.lastZ, T.sumDecrArm, T.sumIncrArm, T.overallAvg from S11 MATCH_RECOGNIZE MEASURES S2.c1 as firstW, lastS1.c1 as lastZ, sumS3.c2 as sumDecrArm, sumS4.c2 as sumIncrArm, avgS5.c2 as overallAvg PATTERNA W+ X+ Y+ Z+ SUBSET S1 = Z S2 = A S3 = A,W,Y S4 = X,Z S5 = A,W,X,Y,Z S6 = Y DEFINE W as W.c2 prevW.c2, X as X.c2 prevX.c2, Y as S6.c2 prevY.c2, Z as Z.c2 prevZ.c2 as T ]]queryParts
» Oracle Fusion Middleware Online Documentation Library
» Streams and Channels Oracle CEP represents a stream as a channel as
» Channel Schema The event source you connect to a stream determines the
» Querying a Channel Once the event source, channel, and processor are
» Controlling Which Queries Output to a Downstream Channel If you specify more
» Relations Relations and Oracle CEP Tuple Kind Indicator
» Range, Rows, and Slide at Query Start-Up and for Empty Relations The descriptions
» Partition Stream-to-Relation Operators Windows
» Default Stream-to-Relation Operator Stream-to-Relation Operators Windows
» Relation-to-Relation Operators Stream-to-Stream Operators
» Event Sources Event Sources and Event Sinks
» Relational Database Table Event Sources
» Function Table Event Sources
» Pattern Recognition Cache Event Sources Functions
» Data Cartridges Fundamentals of Oracle CQL
» Lexical Conventions Oracle CQL Statements
» Oracle CQL and SQL Standards
» Oracle CEP Visualizer Oracle CEP Tools
» Oracle CQL Built-in Datatypes
» Numeric Values Datatype Comparison Rules
» Date Values Datatype Comparison Rules
» Implicit Datatype Conversion Datatype Conversion
» Explicit Datatype Conversion Datatype Conversion
» SQL Datatype Conversion Datatype Conversion
» Oracle Data Cartridge Datatype Conversion
» User-Defined Function Datatype Conversion
» Integer Literals Numeric Literals
» Floating-Point Literals Numeric Literals
» Text Literals Datetime Literals
» Number Format Models Format Models
» Aliases in the relation_variable Clause
» How to Define a Data Type Alias Using the Aliases Element
» Schema Object Naming Guidelines Schema Object Naming Examples
» ELEMENT_TIME for a System-Timestamped Stream
» Using ELEMENT_TIME With SELECT
» Using ELEMENT_TIME With GROUP BY
» Using ELEMENT_TIME With PATTERN
» What You May Need to Know About Unary and Binary Operators
» What You May Need to Know About Operator Precedence
» Comparison Conditions Oracle Fusion Middleware Online Documentation Library
» Logical Conditions Oracle Fusion Middleware Online Documentation Library
» Range Conditions Oracle Fusion Middleware Online Documentation Library
» Null Conditions Compound Conditions
» Using IN and NOT IN as a Set Operation Using IN and NOT IN as a Membership Condition
» Introduction to Common Oracle CQL DDL Clauses
» Introduction to Oracle CQL Built-In Single-Row Functions
» Built-In Aggregate Functions and the Where, Group By, and Having Clauses
» Introduction to Oracle CQLBuilt-In Single-Row Colt Functions
» double c Oracle Fusion Middleware Online Documentation Library
» Introduction to Oracle CQL Built-In java.lang.Math Functions
» User-Defined Single-Row Functions Types of User-Defined Functions
» How to Implement a User-Defined Single-Row Function
» How to Implement a User-Defined Aggregate Function
» Data Cartridge Name Data Cartridge Application Context
» Oracle CQL Data Cartridge Types
» Application Class Space Policy
» No Automatic Import Class Space Policy Server Class Space Policy
» Class Loading Example Class Loading
» Data Cartridge Name Method Resolution
» How to Query Using the Java API How to Query Using Exported Java Classes
» Data Cartridge Name Understanding Oracle Spatial
» Element Info Array Ordinates and Coordinate Systems and the SDO_SRID
» Geometric Relation Operators Scope
» com.oracle.cep.cartridge.spatial.Geometry Methods
» oracle.spatial.geometry.JGeometry Methods The following JGeometry public
» Datatype Mapping Oracle Spatial Application Context
» How to Access the Geometry Types That the Oracle Spatial Java API Supports
» How to Create a Geometry How to Access Geometry Type Public Methods and Fields
» Data Cartridge Name Understanding the Oracle CEP JDBC Data Cartridge
» Scope Understanding the Oracle CEP JDBC Data Cartridge
» Datatype Mapping Understanding the Oracle CEP JDBC Data Cartridge
» function Element Attributes Defining SQL Statements: function Element
» Multiple Parameter JDBC Cartridge Context Functions Using the Oracle CEP
» Overloading JDBC Cartridge Context Functions Using the Oracle CEP JDBC data
» Using SELECT List Aliases Using the TABLE Clause
» Using a Native CQL Type as a return-component-type
» How to Create an Oracle CQL Query
» Where Clause Query Building Blocks
» MATCH_RECOGNIZE Query Queries
» Relational Database Table Query XMLTable Query
» Function TABLE Query Queries
» Sorting Query Results Queries
» Detecting Differences in Query Results
» Parameterized Queries in Oracle CQL Statements
» The bindings Element Parameterized Queries
» Run-Time Query Naming Lexical Conventions for Parameter Values
» Views and Joins Views and Schemas
» Cache Key First and Simple Equality No Arithmetic Operations on Cache Keys
» Oracle CQL Queries and Oracle Data Cartridges
» MATCH_RECOGNIZE and the WHERE Clause Referencing Singleton and Group Matches
» Running Aggregates and Final Aggregates
» Operating on the Same Correlation Variable Referencing Variables That Have not Been Matched Yet
» Using prev Understanding Pattern Recognition With MATCH_RECOGNIZE
» Functions Over Correlation Variables in the MEASURES Clause
» Pattern Quantifiers and Regular Expressions
» Referencing One Correlation Variable From Another in the DEFINE Clause
» PARTITION BY Clause Oracle Fusion Middleware Online Documentation Library
» ORDER BY Clause ALL MATCHES Clause
» WITHIN Clause Oracle Fusion Middleware Online Documentation Library
» Fixed Duration Non-Event Detection
» Recurring Non-Event Detection DURATION Clause
» INCLUDE TIMER EVENTS Clause SUBSET Clause
» Pattern Detection MATCH_RECOGNIZE Examples
» Pattern Detection With PARTITION BY
Show more