Updating a table using a variable number of Update keys
Moderators: chulett, rschirm, roy
Updating a table using a variable number of Update keys
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?
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?
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
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.
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.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
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.
Last edited by miwinter on Wed Jun 10, 2009 7:22 am, edited 1 time in total.
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI