How do I generate a Sequence in Server? that I could write into a column.
Thnks!
Generate Sequence in Server
Moderators: chulett, rschirm, roy
Generate Sequence in Server
Those who throw objects at crocodiles should be asked to retreive 'em.
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.