surrogate key issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Kumar@1988
Participant
Posts: 6
Joined: Wed Dec 29, 2010 12:25 am

surrogate key issue

Post by Kumar@1988 »

Hi,

I have a problem with surrrogate key,ds 8.x.
In surrogate key stage, i want to reset the key value after reaching the particular value(For example ending value 10000) then it will start from begining(for ex 1 2 3 4 ..........10000 ,1 2 3 ........10000).


plz provide the solution

Thanks
Ravi
manoj_23sakthi
Participant
Posts: 47
Joined: Tue Feb 23, 2010 12:16 am
Location: CHENNAI

Re: surrogate key issue

Post by manoj_23sakthi »

Hi,
Instead of using this Surrogate key use row generator and give
Intial value = 1
Final value = 10000
Increment value =1
It will Satisfy your Requirement


Regards,
Manoj
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A surrogate key provides uniqueness. What you are requiring is not uniqueness. Therefore the Surrogate Key Generator stage is not the right stage to use. The approach suggested by Manoj will get you close, though generating the 10000 values in parallel on each node. A better solution will involve an expression that refers to the partition number and the number of partitions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Kumar@1988
Participant
Posts: 6
Joined: Wed Dec 29, 2010 12:25 am

Re: surrogate key issue

Post by Kumar@1988 »

Hi Manoj,

Thak u for sagition but i useing coloumn generator stage i have faced a problem that is if i given limit value is 1000 then it will come only 762 after it will come from first onwards supose if given limit value 2000 then it will come only 1762 after it will come first onwards can u give any sagition
manoj_23sakthi
Participant
Posts: 47
Joined: Tue Feb 23, 2010 12:16 am
Location: CHENNAI

Re: surrogate key issue

Post by manoj_23sakthi »

Hi Kumar,
I think in setting you may did some mistakes reset and try this
Thanks,
Manoj
Post Reply