Added by Matt Casters, last edited by Matt Casters on Jul 10, 2008

Labels:

steps steps Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

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.
  • Connection name: choose the name of the connection on which the database sequence resides
  • Schema name: specify the table's schema name (optional)
  • Sequence name: allows you to enter 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
  • Use counter to calculate sequence: Enable if you want the sequence to be generated by Kettle
  • Counter name (optional): if multiple steps in a transformation generate the same value name, allows you to specify the name of the counter to which you want to associate the. Counter name avoids forcing unique sequencing across multiple steps.
  • Start at: give the start value of the sequence.
  • Increment by: give the increment of the sequence.
  • Maximum value: maximum value after which the sequence return to the start value (Start At).

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.

Comment: Posted by Maxim Varfolomeyev at Aug 25, 2009 11:58