null handling

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

datastagedw
Participant
Posts: 53
Joined: Fri Mar 07, 2008 1:17 am

trimming from varchar to char

Post by datastagedw »

hello,

first of all i think using trim function on a varchar filed and taking it as char in the target will not work because the spaces will not be trimmed as u store it in char.u can do one thing use trim function and populate it into varchar data type only.it does not matter whether the target table is char/varchar.

and if u have blanks or spaces as u say loading into oracle, this being a not null field should not be rejected, i beleive.but if its a not null then obviously it will go for rejects.

basically trimming a field to get rid of spces will not work if u populate them into char datatype, try it.
ETL DEVELOPER
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

Yoyr source is varchar, which just contains one space not five. After trimming the column, it is reduced to the blank stting(Zero length string), Oracle treates the blank string as null. Better you dont tring this particular variable and if triming then assign some default value for the blank string.
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

I seem to recall that when loading oracle, the empty string is interpreted as a null?
Post Reply