Nulls and padding
Posted: Fri Feb 04, 2005 4:40 am
I have this field derivation:
IF IsNull(Lookup_OrderLine.HOIPDNO) THEN " " ELSE FMT(Lookup_OrderLine.HOIPDNO[1,2],"2 L") : IF IsNull(Lookup_MinBX65.BX65TPUR) THEN " " ELSE FMT(Lookup_MinBX65.BX65TPUR[1,2],"2 L")
I was expecting that this would always produce a four-character string. However, if the values are null, it produces a string of two spaces. Any idea why?
I think the values are null because when I map the above and then the two input two fields to a csv sequential file, I get this:
"PK ","PK"," "
" ",,
Update: put in to stop the spaces being compressed
IF IsNull(Lookup_OrderLine.HOIPDNO) THEN " " ELSE FMT(Lookup_OrderLine.HOIPDNO[1,2],"2 L") : IF IsNull(Lookup_MinBX65.BX65TPUR) THEN " " ELSE FMT(Lookup_MinBX65.BX65TPUR[1,2],"2 L")
I was expecting that this would always produce a four-character string. However, if the values are null, it produces a string of two spaces. Any idea why?
I think the values are null because when I map the above and then the two input two fields to a csv sequential file, I get this:
"PK ","PK"," "
" ",,
Update: put in to stop the spaces being compressed