How to create sequence number in Datastage px

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
balu124
Participant
Posts: 49
Joined: Wed Jul 25, 2007 9:53 pm

How to create sequence number in Datastage px

Post by balu124 »

Hi
we are using ODBC as target stage, and there is a column sn_key in the target ,it has values starting from 1 to sequence .....
That extra column is genarated and values pased in the target only.
How to achive that ?
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Re: How to create sequence number in Datastage px

Post by Havoc »

balu124 wrote:Hi
we are using ODBC as target stage, and there is a column sn_key in the target ,it has values starting from 1 to sequence .....
That extra column is genarated and values pased in the target only.
How to achive that ?
What is your database? You can either make that column a sequence column in your table. Thus inserting into that number will generate the next number automatically.

Or you can do a lookup on a dummy column in the table which takes the max(col) and use a surrogate key generator stage and place a transformer to add the values from surrogate key generator with the max value to derive the next sequence number.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In particular you can Search the forum. This question has been answered a number of times, as recently as last week.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply