KeyMgtGetNextValue

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
skintali
Participant
Posts: 10
Joined: Mon Nov 10, 2003 1:32 pm

KeyMgtGetNextValue

Post by skintali »

I , on an experimental basis, used the KeyMgtGetNextValue Transform
as a sequence number generator.
How do I reset this sequence?
I used a number as the argument value for the SequenceName.
Each time, I run the job, it is generating the numbers from where it last generated.
How do I use a name as the argument value for this Transform?

Thanks in advance for all help.

SK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The number you supply forms the primary key in a table called SDKSequences.
To reset it you need an UPDATE statement. However, metadata for the SDKSequences table is not supplied, so you need to "borrow" column definitions from another table (via a USING clause). Note in this example that everything is case sensitive.

Code: Select all

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'yournumber';
In spite of the fact that they're numbers they're stored as strings, and so must be enclosed in single quotes. <i>yournumber</i> is the key value that you used.
This statement is run as a TCL command, using ExecUV as a before/after subroutine, or calling DSExecute with "UV" as the Shell argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
skintali
Participant
Posts: 10
Joined: Mon Nov 10, 2003 1:32 pm

Post by skintali »

Thank you so much, ray. It works. I used as a Before Subroutine TCL command.
Post Reply