How to pass NULL to Date Field

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
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

How to pass NULL to Date Field

Post 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
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: How to pass NULL to Date Field

Post by samyamkrishna »

Instead of setting it to NULL set it to something like 09/09/9999
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

Use nulltovalue function
Srinu Gadipudi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: How to pass NULL to Date Field

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply