Empty String vs Null

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
landaghaar
Participant
Posts: 38
Joined: Wed Sep 19, 2007 10:11 am
Location: Canada

Empty String vs Null

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
landaghaar
Participant
Posts: 38
Joined: Wed Sep 19, 2007 10:11 am
Location: Canada

Post by landaghaar »

I have tried that, still it inserts null to teradata.
Post Reply