query name | Specify the query keyword followed by a name for your query. Like monitors and event types, the identifier you specify as the name of a query must be unique within your application. |
parameters | The parameters section is optional. If you specify a parameters section it must be the first section in the query. Parameters must be integer, float, string or boolean types. Specify one or more data_type parameter_name pairs. Any parameters you specify are available in the inputs section and in the find statement. For more information about parameters and how parameters get their values, see Implementing parameterized queries. |
inputs | The inputs section is required and it must follow the parameters section, if there is one, and precede the find statement. In the inputs section, you must define at least one input. If you specify more than one input each input must be a different event type. The inputs section specifies the events that the query operates on. An input definition can include the keyword, key, followed by one or more fields in the specified event. This is the query key. The correlator uses the key to partition incoming events into separate windows. For example, the cardNumber key indicates that there is a separate window for the Withdrawal events for each card number. In other words, each window can contain Withdrawal events associated with only one account. For details, see Defining query input. |
find statement | After the inputs section, you must specify a find statement. A find statement specifies the event pattern of interest and a block that contains procedural code. This code can define EPL actions you want to perform when there is a match. For more information, see Finding and acting on event patterns. |
action_definition | After the find statement, you can optionally specify one or more actions in the same form as in EPL monitors. An expression in a find statement can reference an action defined in that query. See Defining actions in queries. |