Page 1 of 1

Generate Sequence in Server

Posted: Fri Aug 31, 2007 10:59 am
by ds_is_fun
How do I generate a Sequence in Server? that I could write into a column.
Thnks!

Posted: Fri Aug 31, 2007 11:29 am
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

Posted: Fri Aug 31, 2007 6:29 pm
by ray.wurlod
Do you mean create a sequence, or use a sequence to generate values?

Posted: Fri Aug 31, 2007 9:08 pm
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?

Posted: Fri Aug 31, 2007 9:47 pm
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.