Page 1 of 1

default value for Nullable decimal fields

Posted: Tue Nov 18, 2008 5:04 am
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

Re: default value for Nullable decimal fields

Posted: Tue Nov 18, 2008 5:32 am
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

Posted: Fri Nov 21, 2008 12:29 am
by singhald
do we have any other way to do that without defaulting to any value for null

Posted: Tue Nov 25, 2008 10:29 pm
by infranik
If your target can allow NULLS to be loaded, then it is very much possible to load the NULLS directly.

Posted: Wed Nov 26, 2008 2:50 am
by singhald
my target stage is is sequential stage and am wrting records into delimited flat file

Posted: Wed Nov 26, 2008 5:19 am
by Scope
use NullToEmpty() function.