Provides an example of a CCL query statement that subscribes to all of the data in the StockTrades data stream and publishes it, row by row, to a stream with an identical schema called StockTradesAll.
Here is an example of the simplest possible Query Statement.
INSERT INTO StockTradesAll SELECT * FROM StockTrades;
In practical terms, this query is not very useful, since it simply takes data from one data stream and puts it into another stream. However, it illustrates some important CCL syntax and introductory concepts:
The INSERT INTO clause, which is always the first clause in a Query Statement, indicates the destination of the query output. This query publishes its output to the StockTradesAll stream. All Query Statements provide a single destination to which the query results are be published.
All Query Statements must have a SELECT clause immediately after the INSERT INTO clause. The SELECT clause defines the contents of the query output. This query uses the special asterisk syntax (SELECT *), which indicates that all columns should be selected from the source data stream.
The FROM clause follows the SELECT clause and specifies one or more data sources to which the query subscribes. In this example, the data source is the StockTrades data stream.
A semicolon (;) is used to terminate every CCL statement.
Here is an illustration of data flowing from the StockTrades stream to the StockTradesAll stream after passing through this basic query: