Hi ,
I have to create a surrogate key for a target table by taking the maximum value from the same target table.
For example I get the Maximum value as 100 now I have to insert the values starting from 101 for this I am using the Transformer stage for incrementing the values the Logic is MAXVALUE+INROWNUM.
In the PX the inrow num is not proper because based on the Partitions it is givinig the same rownumbers for next partition.
For Eg
Partion Number Row Number Max(Value)+Rownum
1 1 101
1 2 102
2 1 101
2 2 102
Can you please help me out.
Regards
Shiva
How Can I resolve this
Surrogate Key Generation in PX
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 31
- Joined: Wed Mar 17, 2004 3:33 am
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
You have two ways of doing it. The surrogate key generator stage does handle the multiple partitions to give you unique numbers. You can mimic this in a transformer stage variable following the instructions in the FAQ forum on creating a parallel counter.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Not a fan of the database generated keys unless you have multiple products loading at the same time. The DataStage generated keys do a good job. See my comments at: Why database generated surrogate keys drive me nuts!!!
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn