Page 1 of 1

Posted: Thu May 02, 2002 8:03 pm
by chinek
in oracle db, you can create a sequence ,and from your job connect via odbc to that oracle sequence to get the sequence number.

Posted: Thu May 02, 2002 8:04 pm
by chinek
oops didn't see the next part abt reseting the number. you can drop and recreate the sequence.not tried it but i think you can use OCI to drop sequence in oracle.

Posted: Sat May 04, 2002 9:14 pm
by cwong
The KeyMgtGetNextValue reads in the next value from a hash file named: SDKSequences under the project directory.
The SDKSequences has 2 columns: Key_Name and Next_value
Key_Name is the key of this hash file.

You can have a separate DataStage job to do the resetting or synchronization of the specific Sequence just before it is used in the next job; or do the "update" in the job control of the job which transformer will use the sequence.

When doing the resetting, you can enter the particular value via a parameter. OR most of the time, you would get the current max value from the database table, i.e. select max(cust_id) from d_customer





cwong

Posted: Mon May 06, 2002 1:27 am
by jasper
in DS you can use the variables inrownum and outrownum. I think inrownum is the one you need. This counts for every row in the input and always starts from 1 if the job starts.(migth be a bit tricky if you're rejecting rows from the output).

Posted: Tue May 14, 2002 8:27 am
by Hotstuff
Hi

Logon using the administrator.
Go to the project that you want to reset the seqno. this is as if you generated a surrogate key.
Type in 'ED SDKSequences "the key name you use in the job"' this must be in the same case as specified in the job.
Press execute
l enter Show the last number
R 1 or the start number you want
press enter
fi
Press enter
this saves the counter

when you run your job it will start at 1

Regards


Hendrik Kuhn