Thursday, June 27, 2013

Add Sequence

Use the Add sequence step to add a sequence to a stream. A sequence is a distinct integer value with a specific start and increment value. You can either use a database sequence to generate the value of the sequence, or you can generate the sequence using Kettle.
CAUTION:
Kettle-generated sequences should not be used as unique identifiers when the step runs in a clustered environment.
Sequences generated using Kettle are intended for use within the transformation from which they were created. The values are regenerated each time the transformation is launched. See the Related Reading section for more information about creating unique identifiers or sequencing with other transformation steps.
Option
Description
Step name
The name of this step as it appears in the transformation workspace. This name must be unique within a single transformation.
Name of value
Name of the new sequence value that is added to the stream.
Use DB to generate the sequence
Enable if you want the sequence to be driven by a database sequence, then set these parameters: Connection name, Schema name (optional), Sequence name.
Connection name
The name of the connection on which the database sequence resides.
Schema name (optional)
The table's schema name.
Sequence name
The name of the database sequence.
Use a transformation counter to generate the sequence
Enable if you want the sequence to be generated by Kettle, then set these parameters: Counter name (optional), Start at, Increment by, Maximum value.
Counter name (optional)
If multiple steps in a transformation generate the same value name, this option enables you to specify the name of the counter to associate with. Avoids forcing unique sequencing across multiple steps.
Start at
The value to begin the sequence with.
Increment by
The amount by which the sequence increases or decreases.
Maximum value
The value after which the sequence returns to the Start At value.

Examples
Start at = 1, increment by = 1, max value = 8
This will produce: 1, 2, 3,4,5,6,7,8 1, 2, 3,4,5,6,7,8 1, 2...
Start at = 0, increment by = -1, max value = -3
This will produce: 0, -1, -2,-3, 0, -1, -2,-3, 0...

No comments:

Post a Comment