Page 1 of 1

generation of surroagte key

Posted: Mon May 16, 2005 1:22 pm
by bunny
hi all;

i have 26,000 input records.


based on number of records, i need to genearte surroagte key sequence.

. i am using keymgtgetnextvalue(%sequence name%),


in sequence name i am giving input column totalnet assets which is unique for each row if it exists,

when i run the same job first time it's starting id =1,

when i run the jsame ob for second time it's starting id =2

when i run the jsame ob for third time its' id =3


what might be the problem?

thanks in advance.

Re: generation of surroagte key

Posted: Mon May 16, 2005 3:05 pm
by kris
bunny wrote:. i am using keymgtgetnextvalue(%sequence name%),


in sequence name i am giving input column totalnet assets which is unique for each row if it exists,
You should give a name which is unique for the whole project but not input column which is changing for each record.

Give a name in single quotes something like 'Accounts'

your derivation should look like

Code: Select all

keymgtgetnextvalue('Accounts')
It will generate unique numbers for each record. and when you run next time it will give you the next unique number.

And this seed 'Accounts' is your project dependent. Whenever you feed this to your keymanagement routine you will get a new number.

Kris~

Posted: Mon May 16, 2005 4:55 pm
by harithay
Thank you kris,

Re: generation of surroagte key

Posted: Sat Apr 15, 2006 4:12 am
by asoka_dwh
kris wrote:
bunny wrote:. i am using keymgtgetnextvalue(%sequence name%),


in sequence name i am giving input column totalnet assets which is unique for each row if it exists,
You should give a name which is unique for the whole project but not input column which is changing for each record.

Give a name in single quotes something like 'Accounts'

your derivation should look like

Code: Select all

keymgtgetnextvalue('Accounts')
It will generate unique numbers for each record. and when you run next time it will give you the next unique number.

And this seed 'Accounts' is your project dependent. Whenever you feed this to your keymanagement routine you will get a new number.

Kris~

" whats is the actual syntax for reseting current 'sequence' "

any answers for this regard

Posted: Sat Apr 15, 2006 7:03 am
by chulett
Many answers. A search on 'sdksequences' will turn up much discussion on the subject. As to a code sample:

Code: Select all

UPDATE SDKSequences USING DICT VOC SET F1 = 'YourDesiredValue' WHERE @ID = 'YourSequenceName';
Obviously, you'll need to make a couple of substitutions. :wink:

Posted: Tue Apr 25, 2006 3:48 pm
by jreddy
I tried this, but am getting the error message

DataStage/SQL: Table SDKSequences does not exist

What does this mean.. ? I have done these update many times before.. but on this new server i am getting this error.. any ideas on how to make this work.. thanks in advance

Posted: Tue Apr 25, 2006 4:28 pm
by ray.wurlod
It means that you've never successfully invoked either of the key management functions in that project. If you had, then the hashed file SDKSequences would have been created.
You can create it yourself if you wish, using the following command from the Administrator client's Command window.

Code: Select all

CREATE.FILE SDKSequences 2 1 1 
Note that the file name is case sensitive.