Page 1 of 1

KeyMgtGetNextVal for the same table in two separate jobs.

Posted: Wed Jan 21, 2004 2:54 pm
by frisha
Hi, All!

I loaded information into the table(created rows). For unique sequence I used KeyMgtGetNextVal function. In a future, I would have to add some new rows from different file(output) as an input to the table.
In this case, how would I use KeyMgtGetNextVal to continue sequence number where it was left.
It should metter for relationship with other tables as FK.

Maybe somehow I can update previous ran job? Is it possible?


Thanks.

Re: KeyMgtGetNextVal for the same table in two separate job

Posted: Wed Jan 21, 2004 3:10 pm
by raju_chvr
If you use the same key in the second job also then u shld get continued values. The second job key starts from the point where the First job key has ended.

Is this you what are looking for ?

Posted: Thu Jan 22, 2004 7:59 am
by frisha
Unfortunetely,
my sequence increments each time differently. It is not right sequence and I can not find a pattern. I mean, it is not incremented by same number.

Posted: Thu Jan 22, 2004 8:05 am
by raju_chvr
Can you post the function you are using here ?

It is well tested functionality of DataStage and not new to 6X so, I don't think there is any bug related to it.

Posted: Thu Jan 22, 2004 8:57 am
by frisha
Raju,

After more research, I found that I used this key function as a variable.
And I should not do this for the second job to insert into existing table.
I changed the logic and put it as derivation for primary key and this function does the job (continue incrementing sequence when it was left from previous job).
Thank you for respond and help.