Where Clause Query Building Blocks
18.2.7 Function TABLE Query
Use the TABLE clause to access the multiple rows returned by a built-in or user-defined function in the FROM clause of an Oracle CQL query. The TABLE clause converts the set of returned rows into an Oracle CQL relation. Because this is an external relation, you must join the TABLE function clause with a stream. table_clause::= object_expr::= on page 5-19, identifier::= on page 7-16, datatype::= on page 2-2 Note the following: ■ The function must return an array type or Collection type. ■ You must join the TABLE function clause with a stream. Example 18–7 shows a data cartridge TABLE clause that invokes the Oracle Spatial method getContainingGeometries, passing in one parameter InputPoints.point. The return value of this method, a Collection, is aliased as validGeometries. The relation that the TABLE clause returns is aliased as R2. Example 18–7 Data Cartridge TABLE Query query id=q1[CDATA[ RSTREAM SELECT R2.validGeometries.shape as containingGeometry, R1.point as inputPoint FROM InputPoints[now] as R1, TABLE getContainingGeometriesspatial InputPoints.point as validGeometries AS R2 ]]query Example 18–8 shows an invalid data cartridge TABLE query that fails to join the data cartridge TABLE clause with another stream because the function getAllGeometriesspatial was called without any parameters. Oracle CEP invokes the data cartridge method only on the arrival of elements on the joined stream. Example 18–8 Invalid Data Cartridge TABLE Query query id=q2[CDATA[ RSTREAM SELECT R2.validGeometries.shape as containingGeometry FROM 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, Collections18.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.Parts
» 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