Sequence Generator Transformation in Informatica

⚡ Smart Summary

Sequence Generator transformation in Informatica is the passive, connected object that produces numeric sequences for surrogate and primary key columns, handing every row a value through two fixed output ports named NEXTVAL and CURRVAL.

  • 🔢 Two fixed ports: NEXTVAL carries the generated numbers, and CURRVAL returns NEXTVAL plus the Increment By value.
  • ⚙️ Four core properties: Start Value, Increment By, End Value and Cycle decide the shape of every sequence produced.
  • 🧪 Worked example: Eight Mapping Designer steps load generated numbers into the SNO column of an EMP_SEQUENCE target.
  • ♻️ Reusable option: A reusable Sequence Generator is shared by several mappings and caches 1,000 values by default.
  • 🔒 Ports are fixed: Ports cannot be added, edited or deleted, so all behaviour is controlled from the Properties tab.
  • 🗝️ Surrogate keys: Warehouse dimension tables use generated keys instead of natural keys from the source system.

Sequence Generator Transformation in Informatica

What is Sequence Generator Transformation?

Sequence Generator transformation is passive, so it does not affect the number of input rows. The Sequence Generator is used to generate primary key values, and it is used to generate numeric sequence values like 1, 2, 3, 4, 5 etc.

For example, if you want to assign sequence values to the source records, then you can use Sequence Generator. The generated sequence values can be like 5, 10, 15, 20, 25 etc. or 10, 20, 30, 40, 50 etc. depending upon the configured properties of the transformation.

Unlike most transformations, this one has no input ports at all. It does not read the incoming rows, it simply hands the next number to whichever port it is linked to, which is why it is safe to place beside any pipeline in a mapping.

Ports in a Sequence Generator Transformation

Sequence Generator has two output ports

  • CURRVAL
  • NEXTVAL

CURRVAL port value is always NEXTVAL plus the Increment By value, so it reads as NEXTVAL+1 only while Increment By is left at its default of 1.

To generate the sequence numbers, we always use the NEXTVAL column. The table below sums up how the two ports behave.

Port What it returns When to connect it
NEXTVAL The next number in the sequence for every row that passes through the pipeline. Almost always. This is the port that feeds a key column in the target.
CURRVAL NEXTVAL plus the Increment By value. Only alongside NEXTVAL. Connected on its own, it passes the same constant value for every row.

Neither port can be renamed or removed, and no third port can be added, so every change to the generated numbers is made on the Properties tab rather than on the ports.

Properties of Sequence Generator Transformation

  • Start Value – It is the first value that will be generated by the transformation, the default value is 0.
  • Increment by – This is the number by which you want to increment the values. The default value is 1.
  • End value – It is the maximum value that the transformation should generate.
  • Cycle – if this option is set then after reaching the end of the value, the transformation restarts from the start value.

Three further settings appear on the same tab and matter as soon as the transformation is shared or a session is rerun.

Property What it controls Default
Current Value The value the next session run starts from. The Integration Service updates it in the repository as rows are generated. 1
Number of Cached Values How many values are reserved in memory at a time so that concurrent sessions never hand out the same number twice. 0 for non-reusable, 1000 for reusable
Reset Starts every session from the original current value instead of continuing. It is unavailable on reusable Sequence Generators. Disabled
Tracing Level Amount of detail written to the session log: Terse, Normal, Verbose Initialization or Verbose Data. Normal

How to Use Sequence Generator Transformation in Informatica

In this example, we will generate sequence numbers and store them in the target. Work through the eight steps below in the Mapping Designer.

Step 1) Create a target table with the following script.

Download the above emp_sequence.sql File

Step 2) Import the table in Informatica as target table.

Step 3) Create a new mapping and import EMP source and EMP_SEQUENCE target table. Both definitions now sit on the canvas, as shown below.

Mapping Designer with the EMP source and the EMP_SEQUENCE target definition imported

Step 4) Create a new transformation in the mapping

  1. Select sequence transformation as the type
  2. Enter transformation name “seq_emp”
  3. Select Create option

Create Transformation window with Sequence Generator selected and the name seq_emp entered

Step 5) Sequence Generator transformation will be created, select the done option. The seq_emp object now appears on the canvas with its two ports.

Sequence Generator transformation seq_emp created on the mapping canvas

Step 6) Link the NEXTVAL column of Sequence Generator to SNO column in target.

NEXTVAL port of seq_emp linked to the SNO column of the EMP_SEQUENCE target

Step 7) Link the other columns from source qualifier transformation to the target table.

Remaining Source Qualifier columns linked to the EMP_SEQUENCE target table

Step 8) Double click on the Sequence Generator to open property window, and then

  1. Select the properties tab
  2. Enter the properties with Start value =1, leave the rest properties as default
  3. Select OK button

Properties tab of the Sequence Generator transformation with the start value set to 1

Now save the mapping and execute it after creating the session and workflow.

The sno column in the target would contain the sequence numbers generated by the Sequence Generator transformation.

In our example, the sequences will be like 1 – Scott, 2 – King, 3 – Adam, 4 – Miller, etc.

Reusable and Non-Reusable Sequence Generators

The transformation built above lives inside one mapping. Creating it in the Transformation Developer instead makes it reusable, and the two behave differently once more than one session is involved.

Point of comparison Non-reusable Reusable
Where it is created Inside a single mapping, in the Mapping Designer In the Transformation Developer, then added to any number of mappings
Number of Cached Values Defaults to 0, so values are not reserved in advance Defaults to 1000, so each session reserves its own block of numbers
Reset property Available, and restarts the sequence from the original current value Not available, because restarting would hand out numbers another session already used
Typical use One target key column in one mapping A shared surrogate key across several mappings loading the same dimension

Caching is what keeps concurrent sessions apart. Each session takes a block of numbers up front, which means the numbers stay unique but do not stay contiguous: any values left unused when a session ends are discarded, and the next block starts after them.

Rules and Limitations of Sequence Generator Transformation

Some of these only surface after the mapping has run, so they are cheaper to know before the ports are linked.

  • The ports are fixed. NEXTVAL and CURRVAL cannot be edited or deleted, and no further port can be added to the transformation.
  • CURRVAL on its own returns a constant. Connect CURRVAL only when NEXTVAL is also connected downstream, otherwise every row receives the same value.
  • Two targets are loaded one after another. When NEXTVAL feeds two target tables, the first target is loaded with its numbers before the second target starts, so the two sets do not interleave.
  • Gaps are normal. Cached values that a session does not use are never handed back, so a failed or short session leaves holes in the sequence. Design the key column to tolerate gaps.
  • Cycle can create duplicates. Once the end value is reached with Cycle enabled the numbering restarts at the start value, which will collide with existing keys unless the target allows it.

Because it never reads a row, the transformation adds almost nothing to session runtime, which is why it rarely appears as a bottleneck during performance tuning. Where a key has to depend on the data itself rather than on a counter, an Aggregator or Joiner transformation is the object doing that work, not this one.

FAQs

A surrogate key is a meaningless number that identifies a warehouse row instead of the source system identifier. It stays stable when the source changes its codes, and a generated sequence is the simplest way to produce one.

Because the numbering then lives in the mapping rather than in one database. Flat file and other non-relational targets get keys the same way, and the same reusable object can number several targets without a database object per table.

The End Value accepts up to 9,223,372,036,854,775,807, the largest signed 64-bit integer. Reaching it stops the session with an overflow error unless Cycle is enabled, in which case numbering restarts from the start value.

Yes. NEXTVAL connects to any downstream transformation, most often an Expression that builds a composite key or a Lookup that checks whether a key already exists. The generated number then travels on with the row.

Yes, but check the target first. Editing Start Value or Current Value on a live key column can hand out numbers the target already holds, so raise the value above the highest key rather than lowering it.

Barely. It reads no rows and builds no cache files, so its cost is a counter update per row. Large loads are limited by the reader and the writer long before the numbering becomes an issue.

AI profilers scan source columns to suggest which combination is genuinely unique, flag candidate keys with nulls or duplicates, and detect drift between loads. Machine learning based matching also links records that describe the same entity under different identifiers.

Copilot writes the equivalent SQL sequence or identity definition and the reconciliation queries that prove no key was duplicated. It cannot see your repository values, so verify the current value in the transformation itself before a load.

Summarize this post with: