Hi All,
I'm trying to create a Surrogate key using a Transformer stage. I used the DBSequence type Sequence, and gave all the Oracle Db connection details. In the Database, I created the Database Sequence which I am planning to use. However, I'm unable to understand how to use the sequence value in the Transformer's Derivation Area to be able to generate Output derivation. Can someone kindly guide me on this.
Thanks & Regards,
Sriram
Transformer Stage surrogate key generation
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 96
- Joined: Fri Apr 17, 2009 5:58 am
- Location: Delhi
The Parallel Job Developer Guide quite clearly describes how to setup the Surrogate Key tab in the Stage properties page of a Transformer stage to access a database sequence.
It also mentions using the NextSurrogateKey() function in a derivation to retrieve the keys.
Regards,
It also mentions using the NextSurrogateKey() function in a derivation to retrieve the keys.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 31
- Joined: Fri Aug 01, 2008 2:56 am
From transformer stage you can generate surrogate keys.
First create surrogate key file by using surrogate key stage and use that .sk file in transformer surrogatekey tab file option. give path and file name which you have initialized, in output link assign nextsurrogatekey() then it will generate unique keys.
and all the keys which is generated all store in that file, so at any time it wont take the key which is already created.
First create surrogate key file by using surrogate key stage and use that .sk file in transformer surrogatekey tab file option. give path and file name which you have initialized, in output link assign nextsurrogatekey() then it will generate unique keys.
and all the keys which is generated all store in that file, so at any time it wont take the key which is already created.
madsongtel, the OP's post stated that he is attempting to use a Database Sequence as his key source, not a SK state file.
Craig, I believe you're right. The 8.0 docs on the SKG stage don't say specifically, but the 8.5 docs do say so, that the Database Sequence must be created by the Surrogate Key stage and that you cannot use a sequence previously generated outside of DataStage.
adi_2_chaos, you will need to create your Database sequence using the instructions listed in the Parallel Job Developer Guide under the Surrogate Key Generator section.
Regards,
Craig, I believe you're right. The 8.0 docs on the SKG stage don't say specifically, but the 8.5 docs do say so, that the Database Sequence must be created by the Surrogate Key stage and that you cannot use a sequence previously generated outside of DataStage.
adi_2_chaos, you will need to create your Database sequence using the instructions listed in the Parallel Job Developer Guide under the Surrogate Key Generator section.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 96
- Joined: Fri Apr 17, 2009 5:58 am
- Location: Delhi