Column Flag

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
samba
Premium Member
Premium Member
Posts: 62
Joined: Wed Dec 07, 2005 11:44 am

Column Flag

Post by samba »

In my source table i have flag column it contains "Y" or "Null"

If Source column = 'Y' i need to set CurrentDate() Else SetNull()

Today i populate data into the target column with currentdate(20060918) where source column = 'Y'.
when i try to extract data tomorrow same row will come but i dont want to change my target date to todays date.

That means when the flag becomes 'Null' to 'Y' then only i will populate date after that i dont want change the date.

Target Table:
loading data into oracle with insert and update query.

can any one please help me regarding this..

Thanks in advance
Samba
samba
thumsup9
Charter Member
Charter Member
Posts: 168
Joined: Fri Feb 18, 2005 11:29 am

Post by thumsup9 »

Put a constriant that will Update the Target record only if the Flag is NULL or may be Flag <>'Y'.
samba
Premium Member
Premium Member
Posts: 62
Joined: Wed Dec 07, 2005 11:44 am

Post by samba »

there is no flag column in the target.
only source column has flag.

If the source column = 'Y' i need to populate date in target column.

Thanks in Advance
Samba
samba
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

You will have to join your source data with your Target table and bring in the CurrentDate column. Now you will have two columns 1. CurrentDateFlag from source and 2.CurrentDate from Target.Now put a derivation in the TargetDate column.

Code: Select all

If IsNull(Target.CurrentDate) and IsNull(source.Flag) Then SetNull() Else If Not(IsNull(Target.CurrentDate)) then Target.CurrentDate Else CurrentDate()

Post edited
Last edited by kris007 on Mon Sep 18, 2006 2:38 pm, edited 2 times in total.
Kris

Where's the "Any" key?-Homer Simpson
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

do something like this :

Code: Select all


If current date is not null and if Source column = 'Y' set CurrentDate() Else SetNull() 

Post Reply