Page 1 of 1

How to handle null records for date column in transformer

Posted: Thu Apr 17, 2008 5:58 am
by snt_ds
Hi,

I am getting issue with the date column. Could anyone please help me on this.

The End date and Begin date which are getting from the table with datatype Timestamp. Here in table we have NULL records for End Date. We are taking these records into the transformer and doing some validations.

The issue is if I run the job I am getting the warning like below.

APT_CombinedOperatorController(3),0: Field 'END_DATE' from input dataset '0' is NULL. Record dropped.



validations:

The validation is if the effective date lies between the begin date and End Date we need to take the record. Also if End Date is NULL and effective date is greater than or equal to begin date we also need to pass the record.

Eg:

Record1: Begin Date:01/01/2006 and End Date 'NULL'
Record2: Begin Date:01/01/2006 and End Date 01/01/2007

If Effective Date is 04/01/2006 and 04/01/2008 then these two records need to be populated into the target.



Thanks and Advance
Vamsi

Posted: Thu Apr 17, 2008 6:04 am
by hamzaqk
Yes the irritating issue! you need to cater the null handling here yourself,

put something like

Code: Select all

 IF inputCol.END_DATE is null then '9999/12/31' Else inputCol.END_DATE
you can also do the null handling in the column definition of the source. and you can also define it non nullable in the target.