Adds a new Oracle CQL rule, query, or view to the specified processor of an Oracle Stream Analytics application. If a rule, query, or view with the same name (identified with the rulename
, queryname
, or viewname
parameter) already exists, then the ADDRULE
command replaces the existing rule, query, or view with the new one.
Note:
An Oracle CQL query immediately begins to output events when its input channels provides input events. If you plan to use a query selector on a channel with an upstream Oracle CQL processor, then you might observe unwanted query results on the downstream channel between the time you add the query to the upstream Oracle CQL processor and the time you configure the query selector on the downstream channel.
Syntax
java wlevs.Admin [ Connection Arguments ] [ User Credentials Arguments ] [ Common Arguments ] ADDRULE -application application -processor processor -rule [rulename] rulestring | -query [queryname] querystring | -view [viewname] viewstring [-schema comma-separated-names] [-active true | false]
Table A-7 ADDRULE Arguments
Argument | Definition |
---|---|
-application application
|
Specifies the name of the Oracle Stream Analytics application whose Oracle CQL rules you want to manage. To get the exact name of your application, you can:
|
-processor processor
|
Specifies the name of the particular processor, attached to the Oracle Stream Analytics application specified with the See Query for Application and Processor Names for details on getting the exact name if you do not know it. |
-rule [rulename] rulestring |
Specifies the Oracle CQL rule you want to add to the specified processor of your application. An Oracle CQL rules include:
The Enter the Oracle CQL |
-query [queryname] querystring |
Specifies the Oracle CQL query you want to add to the specified processor of your application. The Enter the Oracle CQL |
-view [viewname] viewstring [-schema comma-separated-names] |
Specifies the Oracle CQL view you want to add to the specified processor of your application. The Enter the Oracle CQL The |
-active true | false |
Specifies if the rule should be started and ready to process events after being added. Valid values for this argument are |
Example
The following example shows how to add the Oracle CQL query SELECT * FROM Withdrawal [Rows 5]
, with name myquery
, to the Oracle CQL processor helloworldProcessor
of the helloworld
application:
java wlevs.Admin -url service:jmx:msarmi://localhost:9002/jndi/jmxconnector -username wlevs -password wlevs ADDRULE -application helloworld -processor helloworldProcessor -query myquery "SELECT * FROM Withdrawal [Rows 5]"