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 — Get the row with the earliest time (based on the stored event's timestamp).
findLatest — Get the row with the latest time.
getCount — Get the number of rows in a table.
findAll — Get all the rows from a table.
findAllSorted — Get all the rows from a table ordered by column.
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.