Page 1 of 1

Ins Upd Del in one Stage

Posted: Wed Aug 21, 2013 11:31 am
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 ?

Posted: Wed Aug 21, 2013 11:55 am
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.

Posted: Wed Aug 21, 2013 12:04 pm
by sriec12
Well there are several transaction need to load in the same way as in file...


how can we do Insert, update , delete ?

Re: Ins Upd Del in one Stage

Posted: Wed Aug 21, 2013 6:02 pm
by SURA
What do you mean Delete?

Posted: Wed Aug 21, 2013 7:07 pm
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->|           |
+---------+       +-------------+       +-----------+

Posted: Thu Aug 22, 2013 7:37 am
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

Posted: Thu Aug 22, 2013 7:45 am
by asorrell
What are you supposed to do if a record is rejected? Stop the entire feed?

Posted: Thu Aug 22, 2013 10:10 am
by sriec12
:) asorrell


Records will not Reject.................Every record should feed into the table

Posted: Thu Aug 22, 2013 2:44 pm
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.

Posted: Thu Aug 22, 2013 3:07 pm
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.

Posted: Thu Aug 22, 2013 4:35 pm
by chulett
asorrell wrote:I'd still like Ray or someone else to confirm that though.
Confirmed. :wink:

Posted: Fri Aug 23, 2013 3:35 am
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?