Ins Upd Del in one 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
sriec12
Participant
Posts: 56
Joined: Mon Nov 01, 2010 5:34 pm

Ins Upd Del in one Stage

Post by sriec12 »

Hello Every one,

I need a logic .....

I have a input file...........It consists of Inserts, Update's and Delete.

What I mean is ,suppose if I have 100 records in file........It should be load in to the table sequentially (Either Inserts, Update's or Delete have to commit one after and another)

Can any one suggest me Idea ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you set your output stage commit size to 1 and run in a single node without parallelism you will achieve what you asked. But the question is why do you feel the need to do it this way.
sriec12
Participant
Posts: 56
Joined: Mon Nov 01, 2010 5:34 pm

Post by sriec12 »

Well there are several transaction need to load in the same way as in file...


how can we do Insert, update , delete ?
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Ins Upd Del in one Stage

Post by SURA »

What do you mean Delete?
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could use a design something like this. Use constraint expressions within the Transformer stage to direct records to the output links depending on whether they're insert, update or delete records.

Code: Select all

+---------+       +-------------+       +-----------+
|         |       |             | -INS->|           |
|         |       |             |       |           |
| SeqFile | ----->| Transformer | -UPD->| Connector |
|         |       |             |       |           |
|         |       |             | -DEL->|           |
+---------+       +-------------+       +-----------+
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sriec12
Participant
Posts: 56
Joined: Mon Nov 01, 2010 5:34 pm

Post by sriec12 »

Thanks Ray.....


I can send the records based on constraints in the transformer.

But my Issue is bit different....

When a Insert record comes till it commits it should not allow other record to either update or delete............there should be delay and every record should commit one by one
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

What are you supposed to do if a record is rejected? Stop the entire feed?
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
sriec12
Participant
Posts: 56
Joined: Mon Nov 01, 2010 5:34 pm

Post by sriec12 »

:) asorrell


Records will not Reject.................Every record should feed into the table
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

It has been forever since I've written a server job, but I think Ray's design would still work as a server job, and would not only be single-threaded, it would apply the records in the same order.

I'd still like Ray or someone else to confirm that though.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Having multiple links into the one database stage will cause all those links to form a single transaction. Set your transaction size (and array size) to 1.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

asorrell wrote:I'd still like Ray or someone else to confirm that though.
Confirmed. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Why dont you just write all the different records to different datasets and create 3 separate jobs to do your insert, update and delete and run them in the sequence you want?
Arun
Post Reply