Generate Sequence in Server

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Generate Sequence in Server

Post by ds_is_fun »

How do I generate a Sequence in Server? that I could write into a column.
Thnks!
Those who throw objects at crocodiles should be asked to retreive 'em.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

Are you going to use a database sequence, like an Oracle Sequence? I don't know about in 8.x, but in 7.5.2 I link an Oracle stage to a transformer then just do a Select on the sequence from Dual and populate the field.

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

Post by ray.wurlod »

Do you mean create a sequence, or use a sequence to generate values?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

Use a sequence to generate values.
ray.wurlod wrote:Do you mean create a sequence, or use a sequence to generate values?
Those who throw objects at crocodiles should be asked to retreive 'em.
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

If you want to generate sequence in database side then database construct can be used. But if it is required to generate in the transformaer then following trick i have used in one of my project:

1. Get the maximum sequence generated from the table in the database. Using the before job subroutine. Store the value in the file.
2. read the file using server subroutine.
3. in transformer add the system variable @INROWNUM to the value read from the file. This will generate a sequence for every incoming record.
Post Reply