insert or upsert the records based on condition

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
eswar1
Participant
Posts: 10
Joined: Sat Jan 01, 2011 6:21 am

insert or upsert the records based on condition

Post by eswar1 »

Hi,

I'm having some issues in production job.
My requirement is based on condition we'll load data either insert or upsert.
In source Tran_type one column.If Tran_type ='IN' then insert mode.
If Tran_type ='UP' then upsert mode
If Tran_type='IN' then insert mode.Please suggest me to design a job to satisfy this requirement.
I have two ideas.I'll create two jobs and in Transformer stage I'll write a constraint as Tran_type='IN' then insert mode.
In another job in Transformer stage I'll write a constraint as Tran_type='UP'
then upsert mode.

I'll design one job and in database I'll write insert query with condition where
Tran_type='IN' and I'll write update query with condition where Tran_type='UP' using upsert mode.

Please suggest me these design will satisfy the given requirement else anything I have to do .

Thanks
eswar
suse_dk
Participant
Posts: 93
Joined: Thu Aug 11, 2011 6:18 am
Location: Denmark

Post by suse_dk »

One job. Two output links from the transformer based on the conditions you mention, each link ends in a connector. So, you'll have a connector for inserts and one for upserts.
_________________
- Susanne
Post Reply