Data Cartridges Fundamentals of Oracle CQL

1-18 Oracle Complex Event Processing CQL Language Reference ■ Oracle JDBC data cartridge: this data cartridge allows you to incorporate arbitrary SQL functions against multiple tables and data sources in Oracle CQL queries and views as you would Oracle CQL native types. See Chapter 17, Oracle CEP JDBC Data Cartridge . For more information, see: ■ Section 14.1, Understanding Data Cartridges ■ Section 14.2, Oracle CQL Data Cartridge Types

1.1.13 Time

Timestamps are an integral part of an Oracle CEP stream. However, timestamps do not necessarily equate to clock time. For example, time may be defined in the application domain where it is represented by a sequence number. Timestamps need only guarantee that updates arrive at the system in the order of increasing timestamp values. Note that the timestamp ordering requirement is specific to one stream or a relation. For example, tuples of different streams could be arbitrarily interleaved. Oracle CEP can observe application time or system time. To configure application timestamp or system timestamp operation, see child element application-timestamped in wlevs:channel in the Oracle Complex Event Processing Developers Guide for Eclipse. For system timestamped relations or streams, time is dependent upon the arrival of data on the relation or stream data source. Oracle CEP generates a heartbeat on a system timestamped relation or stream if there is no activity no data arriving on the stream or relation’s source for more than a specified time: for example, 1 minute. Either the relation or stream is populated by its specified source or Oracle CEP generates a heartbeat every minute. This way, the relation or stream can never be more than 1 minute behind. To configure a heartbeat, see heartbeat in the Oracle Complex Event Processing Developers Guide for Eclipse. For system timestamped streams and relations, the system assigns time in such a way that no two events will have the same value of time. However, for application timestamped streams and relations, events could have same value of time. If you know that the application timestamp will be strictly increasing as opposed to non-decreasing you may set wlevs:channel attribute is-total-order to true. This enables the Oracle CEP engine to do certain optimizations and typically leads to reduction in processing latency. To configure is-total-order, see wlevs:application-timestamped in the Oracle Complex Event Processing Developers Guide for Eclipse. The Oracle CEP scheduler is responsible for continuously executing each Oracle CQL query according to its scheduling algorithm and frequency. For more information on the scheduler, see scheduler in the Oracle Complex Event Processing Developers Guide for Eclipse.

1.2 Oracle CQL Statements

Oracle CQL provides statements for creating queries and views. Introduction to Oracle CQL 1-19 This section describes: ■ Section 1.2.1, Lexical Conventions ■ Section 1.2.2, Syntactic Shortcuts and Defaults ■ Section 1.2.3, Documentation Conventions For more information, see: ■ Chapter 18, Oracle CQL Queries, Views, and Joins ■ Chapter 20, Oracle CQL Statements

1.2.1 Lexical Conventions

Using Oracle CEP IDE for Eclipse or Oracle CEP Visualizer, you write Oracle CQL statements in the XML configuration file associated with an Oracle CEP CQL processor. This XML file is called the configuration source. The configuration source must conform with the wlevs_application_ config.xsd schema and may contain only rule, view, or query elements as Example 1–13 shows. Example 1–13 Typical Oracle CQL Processor Configuration Source File ?xml version=1.0 encoding=UTF-8? n1:config xsi:schemaLocation=http:www.bea.comnswlevsconfigapplication wlevs_ application_config.xsd xmlns:n1=http:www.bea.comnswlevsconfigapplication xmlns:xsi=http:www.w3.org2001XMLSchema-instance processor namecqlProcessorname rules view id=lastEvents schema=cusip bid srcId bidQty ask askQty seq[CDATA[ select cusip, bid, srcId, bidQty, ask, askQty, seq from inputChannel[partition by srcId, cusip rows 1] ]]view view id=bidask schema=cusip bid ask[CDATA[ select cusip, maxbid, minask from lastEvents group by cusip ]]view view ...[CDATA[ ... ]]view ... view id=MAXBIDMINASK schema=cusip bidseq bidSrcId bid askseq askSrcId ask bidQty askQty[CDATA[ select bid.cusip, bid.seq, bid.srcId as bidSrcId, bid.bid, ask.seq, ask.srcId as askSrcId, ask.ask, bid.bidQty, ask.askQty from BIDMAX as bid, ASKMIN as ask where bid.cusip = ask.cusip ]]view query id=BBAQuery[CDATA[ ISTREAMselect bba.cusip, bba.bidseq, bba.bidSrcId, bba.bid, bba.askseq, bba.askSrcId, bba.ask, bba.bidQty, bba.askQty, BBAStrategy as intermediateStrategy, p.seq as correlationId, 1 as priority from MAXBIDMINASK as bba, inputChannel[rows 1] as p where bba.cusip = p.cusip ]]query rules processor