Page 1 of 1

KeyMgtGetNextValue

Posted: Tue Dec 02, 2003 12:50 pm
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

Posted: Tue Dec 02, 2003 6:21 pm
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.

Posted: Wed Dec 03, 2003 12:42 pm
by skintali
Thank you so much, ray. It works. I used as a Before Subroutine TCL command.