Hello there,
Can I use the sequence generated by 'KeyMgtNextValue' in table A to be the sequence in table B. My intension is to use same sequence in both the tables.. If so, can anyone explain to me how to achieve this.
Thanks in advance.
-Yamini
Using the same Sequence in multiple tables
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
KeyMgtNextValue is a BASIC routine. There have been recent posts here about using BASIC Transformer stage in parallel jobs; the same may apply to BASIC routines.
That said, KeyMgtNextValue and KeyMgtNextValueConcurrent do not have any link to anything except the argument value supplied. They can be used to generated as many independent sequences as you can dream up names for. The sequence's next value is stored in a hashed file called SDKSequences, where the key is the sequence name.
If you want the same sequence to be shared between two tables, then do it. What it means is that the two tables (if they began empty and are not updated by any other means) will have entirely disjoint sets of generated values.
That said, KeyMgtNextValue and KeyMgtNextValueConcurrent do not have any link to anything except the argument value supplied. They can be used to generated as many independent sequences as you can dream up names for. The sequence's next value is stored in a hashed file called SDKSequences, where the key is the sequence name.
If you want the same sequence to be shared between two tables, then do it. What it means is that the two tables (if they began empty and are not updated by any other means) will have entirely disjoint sets of generated 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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Using the same Sequence in multiple tables
Hello Ray,
Thank you for your reply. I am, as part of the project, trying to have same sequence in both the tables i.e both the columns in the two tables must have same values when we compare row-by-row.
Can you help me in achieving this with DataStage please.
Thanks in advance.
-Yamini
Thank you for your reply. I am, as part of the project, trying to have same sequence in both the tables i.e both the columns in the two tables must have same values when we compare row-by-row.
Can you help me in achieving this with DataStage please.
Thanks in advance.
-Yamini
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Generate the next value into a stage variable using the KeyMgtGetNextValue function.
Use that stage variable as the derivation for the output column on both output links (one to each table).
Stage variables are evaluated once per input row.
Column derivations are evaluated once per output row per output link.
Use that stage variable as the derivation for the output column on both output links (one to each table).
Stage variables are evaluated once per input row.
Column derivations are evaluated once per output row per output link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 85
- Joined: Fri Jun 04, 2004 2:30 am
- Location: Melbourne, Australia
- Contact:
Alternitavely if the jobs for each table are in seperate jobs then you can always store the MAX value in the Global Variable ( Read this post: viewtopic.php?t=86986&highlight=user+global ).
Cheers,
Dave Nemirovsky
Dave Nemirovsky
Using the same Sequence in multiple tables
Thank you Ray.
-Yamini
-Yamini
Using the same Sequence in multiple tables
Thank you David,
-Yamini
-Yamini