Generator Operator

A Generator operator produces a result set without input.

Like an Iterator, a Generator lets you specify JavaScript expressions for initializing variables, updating variables, and testing for termination. Unlike an Iterator, a Generator does not accept inputs. Like a Projection operator, a Generator allows you to specify the names and types of the output columns, as well as JavaScript expressions for computing the values in each row.

When a Generator is first called, it executes the Initialize expression you supply to initialize variables. On each call, Generator follows this sequence:


  1. Tests the termination condition.

  2. If the termination condition has not been met, it generates a row with the designated schema by executing all of the user-specified JavaScript expressions.

  3. Executes the Increment expression you supply to update variables.

The output of the Generator is the sequence of rows created in these iterations.

Related concepts
Input Source Element
Result Element
Aggregate Operator
Custom Operator
Group By Operator
Intersection Operator
Iterator Operator
Join Operator
Multiplexer Operator
Order By Operator
Projection Operator
Select Operator
Splitter Operator
Union Operator
Update Operator

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com