We have moved to www.dataGenX.net, Keep Learning with us.

Saturday, May 31, 2014

Surrogate Key Generator - Create/Update State File


In last post ( Surrogate Key Generator - Create State File ) we have seen how to generate the surrogate key file, In this post we will discuss about what are the other ways to generate it and how to update state file

Update Surrogate State File (Flat File) :-
To update the state file, add a Surrogate Key Generator stage to a job with a single input link from another stage.


On Row Generator Stage Properties :
Select the no of rows need to generated, by the row generator, to update the State File.


On the Surrogate Stage page, define the stage properties:
    Select the input column to update the state file. The input column usually is the surrogate key column.
    Set the Key Source Update Action property to Update.
    Type or browse for the source name (State File path which want to update).
    Set the Source Type property to Flat File.







Create and Update in Same Job :-
There is a another way where you can create n update the State file in same job. Follow the same process as above defined but "Set the Key Source Update Action property to Create and Update".




There is a one benefit in FIRST process over the SECOND process, we can run again and again the first job ( which is actually business illogical and not going to happen ) whether the SECOND process ( Create n Update ) can be run only one time because when you will try to run second time the job will abort with error that State File is already existing.

Keep an eye on these post series, we will discuss more about surrogate key in next posts.



Like the Facebook Page & join Group
https://www.facebook.com/DataStage4you
https://www.facebook.com/groups/DataStage4you



No comments :

Post a Comment