Input/Output/Local

You can designate streams, windows, and delta streams as input, output, or local.

Input/Output Streams and Windows

Input streams and windows can accept data from a source external to the project using an input adapter or by connecting to an external publisher. You can attach an output adapter or connect external subscribers directly to an input window or input stream. You can also use the SQL interface to SELECT rows from an input window, INSERT rows in an input stream or INSERT/UPDATE/DELETE rows in an input window.

Output windows, streams and delta streams can publish data to an output adapter or an external subscriber. You can use the SQL interface to query (that is SELECT) rows from an output window.

Local streams, windows, and delta streams are invisible outside the project and cannot have input or output adapters attached to them. You cannot subscribe to or use the SQL interface to query the contents of local streams, windows, or delta streams.

Examples

This is an input stream with a filter:
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING);
CREATE INPUT STREAM IStr2 SCHEMA mySchema
	WHERE IStr2.Col2='abcd';
This is an output stream:
CREATE OUTPUT STREAM OStr1
	AS SELECT A.Col1 col1, A.Col2 col2
	FROM IStr1 A;
This is an input window:
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING);
CREATE MEMORY STORE myStore;
CREATE INPUT WINDOW IWin1 SCHEMA mySchema
	PRIMARY KEY(Col1)
	STORE myStore;
This is an output window:
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING);
CREATE MEMORY STORE myStore;
CREATE OUTPUT WINDOW OWin1
	PRIMARY KEY (Col1)
	STORE myStore
	AS SELECT  A.Col1 col1, A.Col2 col2
	FROM IWin1 A;

Local Streams and Windows

Use a local stream, window, or delta stream when the stream does not need an adapter, or to allow outside connections. Local streams, windows, and delta streams are visible only inside the containing CCL project, which allows for more optimizations by the CCL compiler. Streams and windows that do not have a qualifier are local.

Note: A local window cannot be debugged because it is not visible to the ESP Studio run/test tools such as viewer or debugger.

Examples

This is a local stream:
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING);
CREATE LOCAL STREAM LStr1
	AS SELECT i.Col1 col1, i.Col2 col2
	FROM IStr1 i;
This is a local window:
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING);
CREATE MEMORY STORE myStore;
CREATE LOCAL WINDOW LWin1
	PRIMARY KEY (Col1)
	STORE myStore
	AS SELECT i.Col1 col1, i.Col2 col2
	FROM IStr1 i;