Hi,
How do we generate the Unique ID like (1,2,3....) for every row inserted in RDBMS using DataStage.
Thanks
Generate the Unique Sequence ID
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 31
- Joined: Wed Feb 04, 2004 2:04 pm
- Location: Canada
-
- Participant
- Posts: 26
- Joined: Fri Feb 27, 2004 7:23 am
- Location: WI, USA
You can use KeyMgtGetNextValue or KeyMgtGetNextValueConcurrent depending on whether you have mutiple processes using the same sequence key, and then if you need to re-set the keys, you can use a command stage with the following command: UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'your key name';
Starting the Unique Id from 1268264 instead of from 1
Hi,
Is there a way to start the UniqueId from 1268265 rather than from one using KeyMgtGetNextValue.
Thanks
Is there a way to start the UniqueId from 1268265 rather than from one using KeyMgtGetNextValue.
Thanks
RamonaReed wrote:You can use KeyMgtGetNextValue or KeyMgtGetNextValueConcurrent depending on whether you have mutiple processes using the same sequence key, and then if you need to re-set the keys, you can use a command stage with the following command: UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'your key name';
Granted. But there are times when there isn't either the time or the inclination to quote Chapter & Verse on the subject of Better Ways and we simply... answer the question asked.
Besides, I'd rather leave that to Ken most of the time. He's so darn good at it!
Besides, I'd rather leave that to Ken most of the time. He's so darn good at it!
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
This is right.raviyn wrote:Think that Sequence Id is better if created at the DataBase level...
Need to be careful if there is any sort of migration , as these conditions are easily handled at the RDBMS level
Generate a unique sequence in the RDMS. This is use over the different DS projects
Example Orqacle: create a sequence #Sequence_Name#, after that you use this user defines sq voor a new value:
SELECT #Sequence_Name#.NEXTVAL FROM DUAL
Regards,
Erik