Hello,
How would you reset surrogate key value generated to load target table from stating number say '1' again? What's exact routine in Before job sub-routine or command used in DS Adminstrator?
thanks,
Tom
KeyMgtGetNextValue
Moderators: chulett, rschirm, roy
There isn't one. Write a job that does a SELECT MAX(yourkeycolumn) FROM yourtable and puts the result into the appropriate hashed file used by the function.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Re: KeyMgtGetNextValue
That depends on how you generated your surrogate key. If it was generated using Sequence in Target database, then you would follow Kenneth's suggestion. However, if you used the KeyMgmt utility provided in DS, then you can read the SDKSequences into a hashed file with 2 fields (SequenceName as key, and NextVal), and then reset the desired Sequence's NextVal in the transformer. If you want to update it from Administrator command, it has been discussed many times. Search for UPDATE SDKSequences USING DICT VOC. I could write the whole command, but just want you to do a little work.
gateleys
gateleys
I suggest you search the forum for your topic. Generally we update the SDK sequence hashed file with a seperate job. The structure of the SDK Sequence is that it hads the Sequence name and the present value stored. So a Datastage job can take it in a Hash file and update it. Or run this command from Administrator:
I have seen several post by top posters on this topic- do search a while.
Code: Select all
UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Sequence Name';
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
Data Integration Architect
Chicago, IL, USA.