Page 1 of 1

How to pass NULL to Date Field

Posted: Mon Dec 27, 2010 11:55 pm
by srai
Hi Team,

We have a situation where we are getting NULL value for date field.
We are trying to set it NULL in transformer using SetNull() function.
But while loading to the target we are getting error as NULL cant be inserted in database.
Date Columns are nullable clomn in target.

Our source and target database is Teradata 13.

Regards,
Santosh

Re: How to pass NULL to Date Field

Posted: Tue Dec 28, 2010 12:56 am
by samyamkrishna
Instead of setting it to NULL set it to something like 09/09/9999

Posted: Tue Dec 28, 2010 1:08 am
by srinivas.g
Use nulltovalue function

Re: How to pass NULL to Date Field

Posted: Tue Dec 28, 2010 6:47 am
by chulett
srai wrote:But while loading to the target we are getting error as NULL cant be inserted in database.
Date Columns are nullable clomn in target.
You do realize these two statements are contradictory? If your target column was in fact nullable then the error noted would not be occurring. I would suggest you first confirm that your actual database column does not allow nulls and then ask what sort of 'in-band' null value would be appropriate there instead. We use "12/31/9999" as that value where I currently work, as one example.