Page 1 of 1

Column Flag

Posted: Mon Sep 18, 2006 2:06 pm
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

Posted: Mon Sep 18, 2006 2:15 pm
by thumsup9
Put a constriant that will Update the Target record only if the Flag is NULL or may be Flag <>'Y'.

Posted: Mon Sep 18, 2006 2:33 pm
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

Posted: Mon Sep 18, 2006 2:36 pm
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

Posted: Mon Sep 18, 2006 2:36 pm
by Krazykoolrohit
do something like this :

Code: Select all


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