Page 1 of 1

How to create sequence number in Datastage px

Posted: Fri Oct 05, 2007 4:38 am
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 ?

Re: How to create sequence number in Datastage px

Posted: Fri Oct 05, 2007 5:11 am
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.

Posted: Fri Oct 05, 2007 2:17 pm
by ray.wurlod
In particular you can Search the forum. This question has been answered a number of times, as recently as last week.