Assign null value to a date

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
jagadam
Premium Member
Premium Member
Posts: 107
Joined: Wed Jul 01, 2009 4:55 pm
Location: Phili

Assign null value to a date

Post by jagadam »

Hi

I am trying to assign a null value to a date based on a certain condition in the transformer.

If the score is 1 then the data shld be assigned else the date shld be null in DB.

I am using something like
If score=1 then DSJOB start date else ' '

But its failing. How to handle this scenarios?

thanks
NJ
pradeep9081
Participant
Posts: 30
Joined: Tue May 11, 2010 2:05 pm

Re: Assign null value to a date

Post by pradeep9081 »

Use the SetNull() function. and make sure the target column is nullable
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you still need help with this, please don't post "something like" what you are doing - post exactly what you are doing so people can provide the proper help. Also note that saying something "is failing" really doesn't give us anything to work with, always a good idea to post (unedited) any error messages you get from a failure.

Also as noted: two quotes is an empty string which is not the same as null so use the SetNull() function instead.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

If you try to compare a null value OR using it against a lookup then the record may get dropped.
Regards
Sreeni
Post Reply