Page 1 of 1

Empty String vs Null

Posted: Thu Nov 15, 2007 12:16 pm
by landaghaar
I know there was a topic regarding this but it was just explaination which i agree. But we have a situation which we have to insert an empty string to null varchar columns in teradata. When i insert '' and then i select from table i see null, when i insert setNull() i get the same, and when i trim spaces and insert i still get null but not empty string. the problem is when we compare the data, Null is different than empty string. size of null shows as null and size of empty string shows 0.

my question is, what needs to be changed? teradata multiloader, or something needs to be done in a transformer? database is not changed, they have some empty strings and now we want to insert using datastage but we keep inserting nulls.

any suggestion?

Posted: Thu Nov 15, 2007 5:01 pm
by ray.wurlod

Code: Select all

If IsNull(InLink.TheString) Then "" Else InLink.TheString
Note that "" is not a valid value for data types other than VarChar.

Posted: Fri Nov 16, 2007 12:11 pm
by landaghaar
I have tried that, still it inserts null to teradata.