Conditional update of a field

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
fanfanlat
Participant
Posts: 18
Joined: Thu Sep 14, 2006 7:33 am

Conditional update of a field

Post by fanfanlat »

Hi everybody !

I wanted to know if there is a way to make an update of a field only if a certain condition is OK.

I have a lot of fields and I want to update all of them in all cases but one only if a condition is satisfied for a piece of data.

In the transform, I would like to make this test : If link1.myDate > '01/01/2007' Then Update Else (Not update).

I'm afraid I have to make another link to the table in order to manage this case (update of all fields in one row and update of the specific field only if the constraint is satsified...). Am I right ?

Thanks in advance,

Regards,

Fanfan
srinath
Participant
Posts: 9
Joined: Wed Nov 09, 2005 7:18 am

Re: Conditional update of a field

Post by srinath »

Yes, You can do this with 2 links one link with the constraint "link1.myDate <= '01/01/2007' " and updating all the columns and the other link with constraint "link1.myDate > '01/01/2007' " and updating the column that you want to update.
God Gave Me Nothing I Wanted
He Gave Me Everything I Needed -- Swami Vivekananda
Post Reply