4.3.1 REGISTER STREAM clause (stream definition)

Organization of this subsection
(1) Format
(2) Function
(3) Operands
(4) Syntax rules
(5) Notes
(6) Usage example

(1) Format

REGISTER STREAM::=REGISTER[Figure]STREAM[Figure]stream-name
             [Figure]schema-specification-character-strings
   schema-specification-character-strings::='('column-name[Figure]type-name[,column-name[Figure]type-name]...')'

(2) Function

Defines a stream.

This clause registers a stream to the system catalog areas that store stream management tables, and causes the system to begin accepting the stream.

(3) Operands

stream-name

For a stream (input stream), specify any name that is unique within the stream data processing system. For details about specifying names, see 3.2.4 Specifying names.

schema-specification-character-strings

For the stream defined by the stream name, specify column names and their type names.

column-name
Specify any column name that is unique within the stream data processing system. For details about specifying names, see 3.2.4 Specifying names.
The number of column names that can be specified in the range from 1 to 3,000.
type-name
For details about type names, see 3.3 CQL data types.

(4) Syntax rules

Specify all schema specification character strings in a single definition. For example, when defining a stream named s1, specify all of the necessary schema specification character strings as shown in Example 1.

Example 1 (correct specification example):

REGISTER STREAM s1(id INT, name VARCHAR(10));

When defining a stream named s1, if schema specification character strings are specified separately as shown in Example 2, two streams having the same name end up being specified, resulting in an error.

Example 2 (incorrect specification example):

REGISTER STREAM s1 (id INT);
REGISTER STREAM s1 (name VARCHAR(10));

(5) Notes

None.

(6) Usage example

As a schema, a stream named s1, having a column named id of type INT and a column named name consisting of character data of one to ten characters in length, is defined in the system catalog.

REGISTER STREAM s1(id INT, name VARCHAR(10));