SQL Syntax in Event Stream Processor

The ESP On-Demand Query interface allows you to query active windows in a running ESP project using the esp_query tool.

These SQL queries can be run at any time, are ad hoc (for example, you do not need to define them in advance), and they return a snapshot based on the contents of the window at the time of the query. This is an important distinction: SQL queries submitted via the On-Demand Query interface are snapshot queries, unlike CCL queries which are continuous queries.

The On-Demand Query interface is suited for loading data slowly by running infrequent ad-hoc queries. It is not suited for inserting large amounts of data since it does not sustain high data throughput. As a result, it does not support high performance insertion techniques such as batch insertion. Instead, use one of the Publisher APIs (C, Java, or .NET) for high performance insertion.

Note that you can query input and output windows in a running ESP project. Streams and delta streams cannot be queried in on-demand queries since they do not have state, and local windows cannot be queried since they are internal to a project and not visible outside the project.

Use esp_query to query an ESP project as well as the SQL syntax that is supported for on-demand queries.

In order to make SQL queries to a model from your application, you must retrieve and use the ESP JDBC driver. The ESP JDBC driver allows your java client code to make SQL queries through the On-Demand SQL Interface.