Insert Blank space for null value in teradata table

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
Akumar1
Participant
Posts: 48
Joined: Tue May 22, 2007 3:38 am
Location: bangalore
Contact:

Insert Blank space for null value in teradata table

Post 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
Akumar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Akumar1
Participant
Posts: 48
Joined: Tue May 22, 2007 3:38 am
Location: bangalore
Contact:

Post 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:(
Akumar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

NullToValue() might be a better choice of function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply