PowerCenter - Sequence Generator Transformation
Table of Contents
1 - About
Many relational databases include sequences, which are special database objects that generate values. The Sequence Generator transformation functions like a sequence object in a database.
However, in PowerCenter, you do not need to write SQL code to create and use the sequence in a PowerCenter - Mapping.
The Sequence Generator transformation has the following properties:
- The starting number (normally 1).
- The current value stored in the repository.
- The number that the Sequence Generator transformation adds to its current value for every request for a new ID.
- The maximum value in the sequence.
- A flag indicating whether the Sequence Generator transformation counter resets to the minimum value once it has reached its maximum value.
The Sequence Generator transformation has two output ports, NEXTVAL and CURRVAL, which correspond to the two pseudo-columns in a sequence. When you query a value from the NEXTVAL port, the transformation generates a new value.
2 - Articles Related
3 - How to
3.1 - To create the Sequence Generator transformation
- Create a Sequence Generator transformation and name it SEQ_TransformationName.
- Open the Sequence Generator transformation.
- Click the Ports tab. The two output ports, NEXTVAL and CURRVAL, appear in the list.
Note: You cannot add any new ports to this transformation or reconfigure NEXTVAL and CURRVAL.
- Click the Properties tab.
The properties for the Sequence Generator transformation appear. You do not have to change any of these settings.
- Click OK.
- Connect the NEXTVAL column from the Sequence Generator transformation to the ID column in the target table.
- Click Repository > Save.
3.2 - Push the sequence to the database
To know all about how to push the sequence transformation logic into a database, see the doc PC_861_AdvWorkflowGuide.pdf Chapter 4 Working with sequence and view