cancel
Showing results for 
Search instead for 
Did you mean: 

NULL in source gets converted to Blanks in target

Former Member

I am using Data Services to load data from the SQL server to Teradata. For target columns of VARCHAR or CHAR data types in Teradata, if the corresponding source column value is NULL, the data is loaded into the target as a blank field value instead of NULL. But for other datatypes like datetime or int, NULL in source is loaded as NULL in target. I am using the FASTLOAD bulk loader option in Data services to load data into teradata.

Should i change any setting in the data services config file to solve this problem?

Edited by: indumeena on May 31, 2011 9:54 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

use in qurey in mapping tab:

ifthenelse(columnname is null,'  ',columnname)

Former Member
0 Kudos

Hi,

Please try this!

The data type of a NULL value is INTEGER. That's why the Teradata Database returns a blank value by treating Null as a bad character.

Better use cast fucntion for null values.

For example: nvl(<Column_Name>,cast(<Column_Name> as Integer)) ornvl(<Column_Name>,cast(NULL as VARCHAR(10)))

0 Kudos

Maybe yu can user the function nvl located on Miscellaneous Functions with this yuo can replace null value for a specific value

Former Member
0 Kudos

Thanks for your response. But my problem is, I need the NULL value in a source column ( datatype VARCHAR) to be loaded as a NULL value only (NOT Blanks) into a teradata target column (of datatype varchar or char ). I do not have a problem when loading source data of datatypes DATE and INT (NULL in source loaded as NULL in teradata target). It is only with columns of datatype varchar, i have this issue.

My ds.config has the following parameters set as:

LOADER_REPLACE_NULL_WITH=(null)

LOADER_REPLACE_BLANK_WITH=-null-

anil_samudrala
Explorer
0 Kudos

Check the property "ANSI_Varchar_Behavior" in DSConfig.txt. My feeling is that it is FALSE in your environment causing it to treat NULL value for character columns as blanks.

Try setting it to TRUE.

Former Member
0 Kudos

Hi,

Did you find any solution for this problem. If yes, could you please share that with us?

Regards,

Sudhakar