Transformer Stage

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
probal
Participant
Posts: 24
Joined: Sun Oct 25, 2009 10:17 am
Location: kolkata

Transformer Stage

Post by probal »

In my job I have a database table as a source and there are two o/p links from the transformer which is used only for mapping.Two o/p links are for two target database table.One is supposed to be a parent table and the other to be a chi;d table.

Is there any method or functionality available in datastage so that the parent o/p table will be populated first and only then the child table.


Can anyone share some light on this.
Appreciate any kind of help.
Probal
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

this can be done using the muti insert staement .so give the parent table first and then child .and handle rejetcts too.
thanks n regards
nani
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

even with multiple insert statements it may not work unless you have transaction size 1. So that your job commits the master record first. As a workaround you can disable the foreign key constraint, load data and then enable the constraint. But in that case make sure you validate the records prior to loading in job itself.

I would prefer to break the job in 2 and load parent table first and child table in subsequent job.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
probal
Participant
Posts: 24
Joined: Sun Oct 25, 2009 10:17 am
Location: kolkata

Re: Transformer Stage

Post by probal »

Thanks for your replies.
The issue has been resolved using link ordering in the transformer stage.
Probal
SKBurra
Premium Member
Premium Member
Posts: 1
Joined: Thu Jul 10, 2008 4:22 pm

Re: Transformer Stage

Post by SKBurra »

probal wrote:Thanks for your replies.
The issue has been resolved using link ordering in the transformer stage.
Thank you!
SKBURRA
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

People searching this thread in future might also contemplate investigating the Distributed Transaction stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

I don't understand how changing the link order could resolve this. It seems like both tables would load simultaneously no matter what the link order is. What am I missing? I guess I would lean towards two jobs run in sequence for this.

If it is resolved, then you can mark the topic as resolved. I would like to understand the resolution. Thanks.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Link ordering would ensure that the 'master' record is sent to its target first before the child record would begin its journey. If this was a Server job you could use a single target stage and thus keep all of this work in a transaction or unit of work which can cut down on the shenanigans needed. However, having two separate targets means one is not aware of the other and thus (I assume) they are doing as priyadarshikunal suggested, setting both the Array Size and Transaction Size to 1 so that the child record can 'see' the master record when it arrives.

I too would like to see the details of their resolution.
-craig

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