INSERT Statement

Creates one or more rows, and inserts them into a specified stream or window.

Syntax

INSERT INTO StreamWindow ( column [,...] ) VALUES ( value [,...] )

Components

StreamWindow

The name of an input stream or window.

column

The name of a column in a specified stream or window.

value

The corresponding value to insert. There must be as many values as there are specified columns.

Usage

The INSERT statement produces rows of data and publishes them to a destination stream or window. Rows are published to the specified destination any time the statement executes and produces output. To control when the statement executes, an optional OUTPUT clause can be added.

The INSERT statement explicitly indicates the columns to which data should be published, from left to right. The number and data types of the columns specified in the INSERT INTO clause must correspond to the number of items and data types of the column expressions in the VALUES clause.

If the destination stream or window includes more columns than you specify, unlisted columns are set to NULL when rows are published.

Note that you cannot use esp_query to run concurrent INSERT statements on the same window or stream.

Example

INSERT INTO Trades (TradeId, Symbol, Shares, Price) VALUES (1000, 'SAP', 100, 75.50)