default value for Nullable decimal fields

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
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

default value for Nullable decimal fields

Post by singhald »

Hi

I want to know what value we should use if we need to handle null for decimal and date fields and provide some value if thouse contains null value in souce fields.

Please provide some suggestion if some one have already handled decimal and date field without using any type conversion functions.

Regards
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
infranik
Participant
Posts: 20
Joined: Tue Oct 11, 2005 8:11 am

Re: default value for Nullable decimal fields

Post by infranik »

hi,
It depends upon your business logic as what to default the NULLS to in decimals and date fields. We had faced a similar problem and had asked the business to define the defaults incase NULLS were encountered.
Sometimes a NULL value in a decimal field is also correct data. you might default it to 100.0000 , or it could be 0.0 as well..

for dates it could be 9999/12/31 as default or the current system date or processing date - as per the requirement.

cheers,
Nik
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

Post by singhald »

do we have any other way to do that without defaulting to any value for null
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
infranik
Participant
Posts: 20
Joined: Tue Oct 11, 2005 8:11 am

Post by infranik »

If your target can allow NULLS to be loaded, then it is very much possible to load the NULLS directly.
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

Post by singhald »

my target stage is is sequential stage and am wrting records into delimited flat file
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Scope
Premium Member
Premium Member
Posts: 63
Joined: Wed Jun 06, 2007 6:38 am
Location: Chennai

Post by Scope »

use NullToEmpty() function.
Kumarez
Post Reply