Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 11

SEQUENCE

GENERATOR
TRANSFORMATION
The Sequence Generator transformation is a connected
transformation that generates numeric values.
It contains two output ports that you can connect to one or
more transformations.
The output ports are called as CURRVAL and NEXTVAL.
Common Uses for Sequence
Generator
 Create keys.
 Replace missing values.
Sequence Generator Ports
NEXTVAL
The NEXTVAL port can be used to generate sequence
numbers by connecting it to a transformation or target.
The NEXTVAL port when connected to a downstream
transformation, it generates the sequence based on the
Current Value and Increment By properties.
The NEXTVAL port can be connected to more than
one target table in a mapping to generate unique
primary key values for each target table.
The column of unique primary key values is sent to one
target table as a block of sequence numbers.
The second targets receives a block of sequence
numbers from the Sequence Generator transformation
only after the first target table receives the block of
sequence numbers
CURRVAL
CURRVAL is NEXTVAL plus the Increment By value
We will connect the CURRVAL port only when the NEXTVAL port
is already connected to a downstream transformation.
When a row enters the transformation connected to the
CURRVAL port, the Power Center Server passes the last-created
NEXTVAL value plus one.

Figure : Connecting CURRVAL and NEXTVAL Ports to a Target


Sequence Generator
Transformation Properties

Start Value
Increment By
End Value
Current Value
Cycle
Number of Cached Values
Reset
Tracing Level
Start Value
 This value denotes the value to start the sequence with.
 By default it is zero.
Cycle
 Cycle option is used to generate a repeating sequence.

 If selected, the Power Center Server cycles through the sequence


range. Otherwise, the Power Center Server stops the sequence at the
configured end value.
 If disabled, the Power Center Server fails the session with overflow
errors if it reaches the end value and still has rows to process.
 As it cycles, the Power Center Server reaches the configured end
value for the sequence, it wraps around and starts the cycle again,
beginning with the configured Start Value.
Increment By
The Power Center Server generates a sequence (NEXTVAL) based on the
Increment By properties in the Sequence Generator transformation.

Increment By is the integer the Power Center Server adds to the existing
value to create the new value in the sequence. By default, the Increment By
is set to 1.
End Value
End Value is the maximum value you want the Power Center Server to
generate.

If the Power Center Server reaches this value during the session and the
sequence is not configured to cycle, it fails the session.
Current Value
The Power Center Server uses the current value as the basis for
generated values for each session.

To indicate which value we want the Power Center Server to use


the first time it uses the Sequence Generator transformation, we
must enter that value as the current value.

If we want to use the Sequence Generator transformation to cycle


through a series of values, the current value must be greater than
or equal to Start Value and less than the end value.

At the end of each session, the Power Center Server updates the
current value to the last value generated for the session plus one if
the Sequence Generator Number of Cached Values is 0.

Since the Power Center Server uses the current value to determine
the first value for each session, you should only edit the current
value when you want to reset the sequence.

You might also like