Description
The Add sequence step adds a sequence to the stream. A sequence is an ever-changing integer value with a specific start and increment value. You can either use a database (Oracle) sequence to determine the value of the sequence, or have it generated by Kettle.
Note: Kettle sequences are unique only when used in the same transformation. Also, they are not stored, so the values start back at the same value every time the transformation is launched.
Options
The table below contains the options for the Add Sequence step:
| Option | Description |
|---|---|
| Step name | Name of the step; this name has to be unique in 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.
|
| Use a transformation counter to generate the sequence | Enable if you want the sequence to be generated by Kettle
|
Examples:
Start at = 1, increment by = 1, max value = 3
This will produce: 1, 2, 3, 1, 2, 3, 1, 2...
Start at = 0, increment by = \-1, max value = \-2
This will produce: 0, -1, -2, 0, -1, -2, 0...|
Seems worth mentioning here that it is also possible to use Group by step to generate sequential numbers within rows with repeating values.