Apama Documentation : Developing Apama Applications : Developing Apama Applications in EPL : Defining Queries : Implementing parameterized queries : Format for defining query parameters
Format for defining query parameters
You define query parameters in the parameters section of a query definition. The parameters section is optional. If you specify a parameters section, it must follow the metadata section, if defined, and it must precede the inputs section.
The format for specifying the parameters section is as follows:
parameters {
data_type parameter_name;
[ data_type parameter_name; ]...
}
Parameters must be integer, float, string or boolean types. Specify one or more data_type parameter_name pairs. The parameter name can use any of the characters allowed for EPL Identifiers. Any parameters you specify are available throughout the rest of the query.
In the following example, the parameters section is in bold as are the references to the parameters.
query FaultyProduct {
parameters {
       string product;
       float thresholdCost;
       float warrantyPeriod;
}

inputs {
Sale() key customerId within warrantyPeriod;
Repair() key customerId retain 1;
}
find Sale():s1 -> Repair():r1
where s1.product = product
and r1.product = product
and r1.cost >= thresholdCost
{
log "Cost of warranty covered repair for product \"" + product +
"! above threshold $" + thresholdCost.toString() + " by $
" + (r1.cost - thresholdCost).toString() at INFO;
}
}
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback