KeyMgtGetNextValueConcurrent
Moderators: chulett, rschirm, roy
KeyMgtGetNextValueConcurrent
Hi,
We are testing peoplesoft delivered job.In one of them there is a function KeyMgtGetNextValueConcurrent to generate sequence number.
when I ran the job, it created seq numbers from 1 to 10.now I want to reset this number back to 1
I gave this query in adminstrator
UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'NextValue';
it is not updating any records, saying 0 records updated
in one of 2 stage variables
NextValue -If @INROWNUM = 1 Then "w" Else (NextValue)
nextSeq -IF link1.NOTFOUND THEN keyMgtGetNextValueConcurrent(NextValue) Else link2.SRC_SID
We are testing peoplesoft delivered job.In one of them there is a function KeyMgtGetNextValueConcurrent to generate sequence number.
when I ran the job, it created seq numbers from 1 to 10.now I want to reset this number back to 1
I gave this query in adminstrator
UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'NextValue';
it is not updating any records, saying 0 records updated
in one of 2 stage variables
NextValue -If @INROWNUM = 1 Then "w" Else (NextValue)
nextSeq -IF link1.NOTFOUND THEN keyMgtGetNextValueConcurrent(NextValue) Else link2.SRC_SID
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The value you give to @ID in your UPDATE statement must be the same string (the name of the sequence) that you give in the KeyMgtGetNextValueConcurrent() function. Display the contents of SDKSequences to see what I mean.
Code: Select all
SELECT @ID FMT '32L', F1 FMT '10R' FROM SDKSequences USING DICT VOC;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks Ray for the query
It explains me well.Now I am able to update the sequence.
I have one more question
SELECT @ID FMT '32L', F1 FMT '10R' FROM SDKSequences USING DICT VOC;
VOC ------------------------------------------------F1 ------------
HCM 3
EPM 12
numbers under F1 field are no of records, right ?
can we open the sequence and see the records to get the max seq no.I think here it shows only number of records in the sequence.
like this
select * from SDKSequences where @ID = 'EPM';
Thanks
It explains me well.Now I am able to update the sequence.
I have one more question
SELECT @ID FMT '32L', F1 FMT '10R' FROM SDKSequences USING DICT VOC;
VOC ------------------------------------------------F1 ------------
HCM 3
EPM 12
numbers under F1 field are no of records, right ?
can we open the sequence and see the records to get the max seq no.I think here it shows only number of records in the sequence.
like this
select * from SDKSequences where @ID = 'EPM';
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not quite right. What's in field F1 is the next available key value. It's ordinarily one more than the number of records, provided that this is the only method used for maintaing the keys.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 69
- Joined: Tue Jan 18, 2005 12:15 am
you can open the sequence file, this file is a hashed file and will be available under projects/<your project name>, the name of file is SDKSequences.
To access the file create a job and use a hashed stage, create two columns with varchar(10), check the first column as key, then write the detail to sequence file, where u can update the particular sequence name(name which is used in keymgt function) to specified value. Then create a job to re-create the hashfile.
Magesh S
To access the file create a job and use a hashed stage, create two columns with varchar(10), check the first column as key, then write the detail to sequence file, where u can update the particular sequence name(name which is used in keymgt function) to specified value. Then create a job to re-create the hashfile.
Magesh S
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 69
- Joined: Tue Jan 18, 2005 12:15 am
The other sequences within the project will not be affected by recreating the hashfile.
suppose there are two sequence in a project Seq1 and Seq2, and if we change Seq1 and recreate the hashfile, Seq2 will also be created without the changed values(since we are not deleting the Seq2 from the file for creating hashfile) and has worked fine
Magesh S
suppose there are two sequence in a project Seq1 and Seq2, and if we change Seq1 and recreate the hashfile, Seq2 will also be created without the changed values(since we are not deleting the Seq2 from the file for creating hashfile) and has worked fine
Magesh S
We're obviously stumbling over the meaning of the word 'recreate'.
It means to delete and then create again. This implies the new file would be empty which is why Ray made his comment and which would definitely effect every other sequence that was (formerly) held by that static hashed file.
I suspect maheshsada actually means 'update'. Or you need to be more careful in your advice and be more clear on the process you are suggesting, otherwise you could cause someone to do themselves some damage.
This is certainly the long way to accomplish this, but it sounds like you suggesting two jobs. One to dump the contents of the SDKSequences to a flat file where one would edit the value(s) in question. And then a second job to recreate the hashed file and then reload it from the flat file. Yes, that would certainly work.
Best to just issue the UPDATE sql.
It means to delete and then create again. This implies the new file would be empty which is why Ray made his comment and which would definitely effect every other sequence that was (formerly) held by that static hashed file.
I suspect maheshsada actually means 'update'. Or you need to be more careful in your advice and be more clear on the process you are suggesting, otherwise you could cause someone to do themselves some damage.
This is certainly the long way to accomplish this, but it sounds like you suggesting two jobs. One to dump the contents of the SDKSequences to a flat file where one would edit the value(s) in question. And then a second job to recreate the hashed file and then reload it from the flat file. Yes, that would certainly work.
Best to just issue the UPDATE sql.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: