Named queries
Apama applications can use named queries. Named queries are templates with parameterized values and are stored in Apama projects. Queries of this type provide advantages for queries that will be used multiple times. They also serve to keep the SQL query strings separate from the application's EPL code.
To use a named query, your EPL code needs to specify the query template name and the template parameter names and values to use when it initializes the query. The template name and parameters are used when the query is submitted to the database.
You define a named query as a query template in the ADBC adapter’s ADBC-queryTemplates-SQL.xml file. This file contains some pre-built named queries:
 findEarliest
findEarliest — Get the row with the earliest time (based on the stored event's timestamp).
 findLatest
findLatest — Get the row with the latest time.
 getCount
getCount — Get the number of rows in a table.
 findAll
findAll — Get all the rows from a table.
 findAllSorted
findAllSorted — Get all the rows from a table ordered by column.