Dynamic number
Moderators: chulett, rschirm, roy
Dynamic number
Hi all,
I must insert on my table an dynamic number called by PROCESS_NUMBER. So this number must be different each time i run my DS job.
Any idea ?
I must insert on my table an dynamic number called by PROCESS_NUMBER. So this number must be different each time i run my DS job.
Any idea ?
Diogo de Oliveira Vasconcellos
diogo.cwb@gmail.com
diogo.cwb@gmail.com
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Can't i make an Oracle stage to select max(PROCESS_ID) and on Transformer i increase +1 ?
Diogo de Oliveira Vasconcellos
diogo.cwb@gmail.com
diogo.cwb@gmail.com
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
there are number of ways to do it if you just want a unique process number to be populated in to target.
One of them is like you mentioned.
you can select max(process_number)+1 as process_number and feed it to your input record.
One of them is like you mentioned.
you can select max(process_number)+1 as process_number and feed it to your input record.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
ok. but tis solution doesn't increase my number each row ? because i don't want it.
Diogo de Oliveira Vasconcellos
diogo.cwb@gmail.com
diogo.cwb@gmail.com
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
As long as you do not change the PROCESS_NUMBER column in the table it is max() from, the value will remain same.
In other words, commit the max(PROCESS_NUMBER) + 1 back in the table after successful completion of current run.
If it is from the same target table where you are loading the rows, then extract the value into an hash file or something similar. That way you avoid referring your target table.
In other words, commit the max(PROCESS_NUMBER) + 1 back in the table after successful completion of current run.
If it is from the same target table where you are loading the rows, then extract the value into an hash file or something similar. That way you avoid referring your target table.
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
It will be a static value for the job unless you change it. If you want to be constant for all jobs for a perticular then get the value in sequence and pass it to all the jobs as parameter or store it in sequential file or hashed file and use it in jobs.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.