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

Unit 8.

Sequence Generator

Unit 8

Unit Objectives
Understand when and how to use the Sequence
Generator transformation
Use it in a mapping

Unit 8

Sequence Generator
Transformation
Generates unique keys for any port on a row

Passive
Ports
Two predefined output ports,
NEXTVAL and CURRVAL
No input ports
Usage
Generate sequenced keys
e.g. unique primary keys
Shareable across mappings

Unit 8

Sequence Generator (contd)

Whenever a row is written to the Expression transformation:

NEXTVAL is written to the target

NEXTVAL is set to the value of CURRVAL

CURRVAL is increased by the Increment By value set in properties

Use CURRVAL only if you need a second sequenced output (only increases when NEXTVAL used)
If you connect NEXTVAL to two transformations, it generates unique sequence number blocks
(first one, then the other)

Unit 8

Unit 8 Lab
Load Date Dimension Table
Create a mapping using:
Shortcuts for source and target
Sequence Generator transformation
Create/run a workflow for this mapping

Staging
Area

Data
Warehouse

STG_DATES
(table)

DIM_DATES
(table)

Unit 8

Lab Review
What did we accomplish with this lab?
Questions?

Unit 8

Unit 8 Quiz
1. When would you use the Sequence Generator
transformation?
2. What is the relationship between CURRVAL and
NEXTVAL?

Unit 8

You might also like