Hi
Is there a possibility in DataStage PX to generate a surrogate key which is continuous for multiple runs also.
For Example: If in 1 run, the surrogate key generator generates 1 through 10 keys, then in next run the key count should start from 11 and continue the count from there on.
Thanks in Advance
Continuous Surrogate key generation for multiple runs
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 9
- Joined: Mon Nov 12, 2007 11:38 pm
- Location: Hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In Datastage u can, But u have to pass maximum value of last run to startvalue by manually. By Using the Oracle Sequences you can achieve this with out passing any params by manually. Just create a sequence in oracle and use it where u required.
Ex: Insert in to table(empid,ename, sal) values (oracle_sequence.nextval, orchestrate.ename, orchestrate.sal)
Ex: Insert in to table(empid,ename, sal) values (oracle_sequence.nextval, orchestrate.ename, orchestrate.sal)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
U did not ask the question. U is the name of one of our posters.
This is one of the reasons we ask posters to adhere to a professional standard of written English on DSXchange. DSXchange is not a mobile telephone; SMS may have its place, but DSXchange is not that place.
This is one of the reasons we ask posters to adhere to a professional standard of written English on DSXchange. DSXchange is not a mobile telephone; SMS may have its place, but DSXchange is not that place.
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.
Yes ... using the database sequences definitely slowed our jobs significantly... The more data we tried processing, the worse the performance got ... We have to go for a re-design
....
This is what we are doing(trying to
) ......We have created a UNIX script which returns the maximum of the sequence from the table. We are returning this Value as output of this script.
In the sequencer job we are calling this before the required job and pass the output to the job
Now i am working on whether i can pass the pouput directly in the sequencer or whether i will need to assign this to a variable in UNIX script only ....
Will keep you posted once i get something ....
![Confused :?](./images/smilies/icon_confused.gif)
This is what we are doing(trying to
![Embarassed :oops:](./images/smilies/icon_redface.gif)
In the sequencer job we are calling this before the required job and pass the output to the job
Now i am working on whether i can pass the pouput directly in the sequencer or whether i will need to assign this to a variable in UNIX script only ....
Will keep you posted once i get something ....
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Could I suggest using a DataStage job (a server job is most efficient) rather than a UNIX script for extracting the next value from the target table? Using the server job's user status area makes it easier for the job sequence to retrieve the value, which it can do with an unqualified reference to the activity variable $UserStatus.
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.