Page 1 of 1

Updating a table using a variable number of Update keys

Posted: Wed Jun 10, 2009 4:33 am
by Gokul
Hi ,

The update strategy for an oracle table depends on existence of the fields in the source .

e.g if Fields A and B are present but c and D are absent then
update the table M set B := source.B, using A as key.

IF fields A and B are absent but C and D are present then
Update the table M set D := source.D , using C as key.

Can this be done in a single Oracle Stage?

Posted: Wed Jun 10, 2009 4:40 am
by nagarjuna
I think this cannot be done in a single oracle stage ...Also ,Do you mean field absent is null value in that field ??

Posted: Wed Jun 10, 2009 5:11 am
by Gokul
Yes.. The field been absent means it is NULL.

Posted: Wed Jun 10, 2009 5:14 am
by miwinter
This isn't possible in a single stage, you'd need to have determined the logic ahead of DB operations and route accordingly with different update keys and requirements to seperate stages.

Posted: Wed Jun 10, 2009 5:36 am
by priyadarshikunal
Can't say if it is useful in your scenario, but you can use case statement in update query. and passing a flag from an upstream transformer can reduce the complexity.

I am not sure if you can put a case statement as argument of SET but you can give it a shot.

Else you can go for miwinter's suggestion.

Posted: Wed Jun 10, 2009 7:07 am
by chulett
Of course you can use a single stage, it's a single link you can't use. Just create a link for each combination needed and send your data down the correct one.

Posted: Wed Jun 10, 2009 7:19 am
by miwinter
Oracle stages must work differently to others then. As for DB2, you can't assign more than one stream input to it. Unless the OP should have actually posted in the correct forum.

Posted: Wed Jun 10, 2009 7:21 am
by chulett
Perhaps. Note that this is a Server answer, in which the OCI stage allows multiple inputs, it just means they must all connect to the same instance. PX doesn't allow it, however.

Posted: Wed Jun 10, 2009 10:11 am
by priyadarshikunal
This post was for server??? :shock:

I thought its for parallel, because of the forum!!

Moderator: Please move this to server forum.

Posted: Wed Jun 10, 2009 10:39 am
by chulett
Well, it is marked as a Server job in the original post and more people tend to get that right than to post in the correct forum, it seems. :wink: We'll have to see what Gokul says.