Page 1 of 1

Difference in key management functions

Posted: Wed Mar 22, 2006 11:54 am
by tostay2003
Hi all,

Got few doubts

What are the differences between
a) KeyMgtGetNextValue -> Generates Sequential numbers
b) KeyMgtGetNextValueConcurrent-> whats the meaning of concurrent environment.
c)KeyMgtGetMaxKey-> help in datastage informs to use ODBC stage for this, can we use other stages as well? and what does this do?


other questions :

1) How to generate sequential numbers starting from certain values using all the above 3 functions.
2) The sequential numbers start from last value, even if i truncate the table in database and restart the datastage? Shouldnt it start from 1 as earlier. If i need it that way what should i do.

Thanks a lot for your cooperation.

Regards

Posted: Wed Mar 22, 2006 3:16 pm
by tostay2003
Hi no one is answering :(

Posted: Wed Mar 22, 2006 4:10 pm
by kcbland
Concurrent means simultaneous jobs are calling the function for the same table.

Surrogate key assignment outside a database requires a "seed" value, in other words the maximum value in the target table. You need to set the seed value prior to calling the function to make sure your database value matches what's in the storage point of the seed.

I recommend you spend some time searching the forum and learning about surrogate key assignment.

Posted: Wed Mar 22, 2006 4:11 pm
by ArndW
Correct, nobody is answering (so far).

Part of the reason that I am not interested in doing is that you mixed questions and statements and said you have "doubts". Another part is that the source code is available for you to do your own research. For example - could the difference between "KeyMgtGetNextValue" and "KeyMgtGetNextValueConcurrent" have something to do with one dealing with concurrent (i.e. parallel) runs? Just a glance at the manager and code will show that the comments actually explain this.

Your other questions show that instead of looking at the code or documentation or writing a test job or two with these routines you have decided to post all-encompassing questions here. So instead of getting help here for this issue you've decided to get the answers presented on a plate. I am sure that someone else will be able to assist you in this. Maybe. Or you could post a specific question on some aspect of key management that you would like assistance on and see that you will get a more immediate and certainly a more cordial response.

Posted: Wed Mar 22, 2006 5:36 pm
by ray.wurlod
I didn't answer because I was asleep (different time zone from yours). The others' answers have covered any ground I would have covered. That's the way of things at an all volunteer site.

Posted: Wed Mar 22, 2006 6:02 pm
by vsi
ArndW wrote:Correct, nobody is answering (so far).

Part of the reason that I am not interested in doing is that you mixed questions and statements and said you have "doubts". Another part is that the source code is available for you to do your own research. For example - could the difference between "KeyMgtGetNextValue" and "KeyMgtGetNextValueConcurrent" have something to do with one dealing with concurrent (i.e. parallel) runs? Just a glance at the manager and code will show that the comments actually explain this.

Your other questions show that instead of looking at the code or documentation or writing a test job or two with these routines you have decided to post all-encompassing questions here. So instead of getting help here for this issue you've decided to get the answers presented on a plate. I am sure that someone else will be able to assist you in this. Maybe. Or you could post a specific question on some aspect of key management that you would like assistance on and see that you will get a more immediate and certainly a more cordial response.
The thing is i am a) completely new to datastage, cant read code properly (b) dont have any Enterprise Edition with me (c) Not working in any company so far. Only documents i have got with me is server guide and parallel guide, with internet connection and offcourse a little access (whenever system is free) to server edition.

Posted: Thu Mar 23, 2006 2:12 am
by ArndW
OK, but keep your posts less complex to answer. Your original post needs a lot of time to answer, you posted about 8 different questions at the same time - we are volunteers here.

The difference between the normal KeyMgtGetNextValue and KeyMgtGetNextValueConcurrent is that the first routine is meant to be used by one process in one job. If two processes were to concurrently use this routine it might result in duplications. The concurrent one takes care of that, but it is less efficient than the former.

Re: Difference in key management functions

Posted: Thu Mar 23, 2006 9:57 am
by gateleys
tostay2003 wrote:1) How to generate sequential numbers starting from certain values using all the above 3 functions.
2) The sequential numbers start from last value, even if i truncate the table in database and restart the datastage? Shouldnt it start from 1 as earlier. If i need it that way what should i do.
Regards
The sequential numbers generated by DataStage are stored in a hashed file called SDKSequences in your project folder. To answer your second question- This SDKSequences is NOT in sync with the external database(s). Hence, you truncating the table will have no impact on the DS sequence. However, regarding the first question, you can update the SDKSequences against your sequence from commandline to set it to the value that you want. Alternatively, you can create a job with a hashed file that reads the sequences, and manipulate the NextValue to suit your need.

gateleys