param The param child element specifies an optional input parameter. sql The sql child element specifies a SQL statement. This child element is

Oracle CEP JDBC Data Cartridge 17-11 param name=inpName type=char return-component-type com.oracle.cep.example.jdbc_cartridge.RetEvent return-component-type sql[CDATA[ select description as description, sumamt as totalamt, count as numTimes from OrderDetails where orderid in select orderid from PlacedOrders where empid in select empid from Employee where empName = :inpName group by description having sumamt :limit ]]sql function ...

17.2.1.3.4 Overloading JDBC Cartridge Context Functions Using the Oracle CEP JDBC data

cartridge, you can define JDBC cartridge context functions with the same name in the same application context provided that each function has a unique signature. Example 17–11 shows an Oracle CEP JDBC data cartridge application context that defines two JDBC cartridge context functions named getDetails. Each function is distinguished by a unique signature. Example 17–11 Oracle JDBC Data Cartridge Context Function Overloading jc:jdbc-ctx nameJdbcCartridgeOnename data-sourceStockDSdata-source function name=getDetails param name=inpName type=char return-component-type com.oracle.cep.example.jdbc_cartridge.RetEvent return-component-type sql[CDATA[ SELECT Employee.empName as employeeName, Employee.empEmail as employeeEmail, OrderDetails.description as description FROM PlacedOrders, OrderDetails , Employee WHERE PlacedOrders.empId = Employee.empId AND PlacedOrders.orderId = OrderDetails.orderId AND Employee.empName=:inpName ORDER BY —SQL query using ORDER BY -- description desc ]]sql function function name=getDetails param name=inpOrderId type=int sql[CDATA[ SELECT Employee.empName as employeeName, Employee.empEmail as employeeEmail, OrderDetails.description as description FROM PlacedOrders, OrderDetails , Employee WHERE PlacedOrders.empId= Employee.empId AND PlacedOrders.orderId = OrderDetails.orderId AND PlacedOrders.orderId = :inpOrderId ]]sql 17-12 Oracle Complex Event Processing CQL Language Reference function jc:jdbc-ctx

17.2.2 Defining Oracle CQL Queries With the Oracle CEP JDBC Data Cartridge

This section describes how to define Oracle CQL queries that invoke SQL statements using the Oracle CEP JDBC data cartridge, including: ■ Section 17.2.2.1, Using SELECT List Aliases ■ Section 17.2.2.2, Using the TABLE Clause ■ Section 17.2.2.3, Using a Native CQL Type as a return-component-type For more information, see Configuring Oracle CQL Processors in the Oracle Complex Event Processing Developers Guide for Eclipse.

17.2.2.1 Using SELECT List Aliases

Consider the Oracle CEP JDBC data cartridge context function that Example 17–12 shows. Example 17–12 Oracle CEP JDBC Data Cartridge Context Function jc:jdbc-ctx nameJdbcCartridgeOnename data-sourceStockDSdata-source function name=getDetailsByOrderIdName param name=inpOrderId type=int param name=inpName type=char return-component-type com.oracle.cep.example.jdbc_cartridge.RetEvent return-component-type sql[CDATA[ SELECT Employee.empName as employeeName, Employee.empEmail as employeeEmail, OrderDetails.description as description FROM PlacedOrders, OrderDetails , Employee WHERE PlacedOrders.empId = Employee.empId AND PlacedOrders.orderId = OrderDetails.orderId AND Employee.empName = :inpName AND PlacedOrders.orderId = :inpOrderId ]]sql function jc:jdbc-ctx You must assign an alias to each column in the SELECT list. When you invoke the JDBC cartridge context function in an Oracle CQL query, you access the columns in the result set by their SQL SELECT list aliases. For more information, see Section 17.2.2.2, Using the TABLE Clause .

17.2.2.2 Using the TABLE Clause

Consider the Oracle CEP JDBC data cartridge SQL statement that Example 17–13 shows. Example 17–13 Oracle CEP JDBC Data Cartridge SQL Statement ... jc:jdbc-ctx