4.4.2 Stream clause

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

(1) Format

stream-clause::={ISTREAM|DSTREAM
              |RSTREAM['['integer-constant[[Figure]time-specification]']']}

(2) Function

Converts the data to be output into a stream.

(3) Operands

ISTREAM

Outputs only the items added to the output relation.

DSTREAM

Outputs only the items deleted from the output relation.

RSTREAM

Outputs all of the items in the output relation at regular time intervals.

integer-constant

Specifies the time interval. For the value range of an integer constant, see 4.4.16 Time specification.

If you do not specify a constant, 1 second is assumed.

time-specification

Specifies a unit for the time interval specified in integer-constant. For details about specifying time, see 4.4.16 Time specification.

If you do not specify this, the value specified in integer-constant is assumed to be in seconds.

(4) Syntax rules

Enter the details of the stream clause to be defined in the inquiry. Specify a relation expression, enclosed in parentheses (( )) following the stream clause.

(5) Notes

None.

(6) Usage example

Generates a stream that has the time stamps of the newly added data in relation s1. The generated stream is output as the stream q1. The underlined part indicates the stream clause.

REGISTER QUERY q1 ISTREAM (SELECT * FROM s1[ROWS 100]);