what is use of surrogate key?when we u r using this?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
harikumar
Participant
Posts: 33
Joined: Wed Apr 21, 2010 9:19 pm
Location: banglore

what is use of surrogate key?when we u r using this?

Post by harikumar »

hi
Karthik.M
Participant
Posts: 24
Joined: Thu Apr 26, 2012 1:18 am
Location: Chennai,TamilNadu

Post by Karthik.M »

Surrogate key generator stage is used to generate a unique random number for each record in each run in a separate column.
This stage is useful when records are loaded everyday dynamically and each record needs to be identified uniquely.
Karthik.M
Analyst
Infotrellis.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The second person personal pronoun in English is spelled "you".

The present tense plural of the verb "to be" is spelled "are".

We strive for a professional standard of written English on DSXchange, not least to make life a little easier for those whose first language is not English.

Karthik.M wrote:a unique random number
This is not correct. The Surrogate Key Generator (or its equivalent function) generates a sequence of uint64 values, possibly in blocks. They are not random at the point of generation, which uses either a state file or a database sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

A surrogate key is a unique primary key that is not derived from the data that it represents, therefore changes to the data will not change the primary key. In a star schema database, surrogate keys are used to join a fact table to a dimension table.
Thanx and Regards,
ETL User
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

chandra.shekhar@tcs.com wrote:A surrogate key is a unique primary key that is not derived from the data that it represents, therefore changes to the data will not change the primary key. In a star schema database, surrogate keys are used to join a fact table to a dimension table.
Straight out of the documentation for the stage. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: what is use of surrogate key?when we u r using this?

Post by chulett »

harikumar wrote:hi
Harikumar, you really should put together better posts than this. Rather than "hi" you might have simply put "Surrogate key" as your subject and then a more fleshed out version of your questions in the post itself. Something more like:

What is the use of a surrogate key? When does one use this?

Of course, the simplest answer is to have you search for that information online as it has nothing directly to do with DataStage. Of course, you'll have to wade through the 7.4 million results that query returns, including this Wiki entry which is a good starting point.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply