Page 1 of 1

Insert Blank space for null value in teradata table

Posted: Wed Aug 10, 2011 7:37 am
by Akumar1
Hi All,
I am not able to find if there is an environment variable to insert single space to a field in case incoming data is NULL while loading to a Teradata table.

I am aware that this we can achieve with Oracle DB using APT_ORACLE_PRESERVE_BLANKS, but not sure how to achive in teradata

Any help

Posted: Wed Aug 10, 2011 7:52 am
by chulett
No, that Oracle variable does basically the opposite of this. You need to handle the null and explicitly convert it to a space before sending it to the target.

Posted: Wed Aug 10, 2011 8:13 am
by Akumar1
Basically We are reading a flat file and the culpret column is coming with null values which is actually a not null column in target and using transformer stage I am trying to load into Teradata table using Mload , but it is again and again failing with 3604 error message (Cannot place a null value in a NOT NULL field. ) the we tried below option
bot none of them are working for that column

If isnull(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN) THEN ' ' ELSE TRIM(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN)



If isnull(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN) THEN " " ELSE TRIM(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN)


Tried converting NullToZero , this is also not working

If isnull(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN) THEN NullToZero(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN) ELSE TRIM(CcartDirSymp507AgtPerfDlyUps_Merged_Data.SUPERVISOR_LOGIN)


Am I doing something wrong here:(

Posted: Wed Aug 10, 2011 3:43 pm
by ray.wurlod
NullToValue() might be a better choice of function.