AS400 Empty cell question -
02-10-2006
, 09:28 AM
Hello again!
Have a field coming in from an AS400 that's "empty" (if i highlight it
in kinda looks like there might be a space there, but no letter,etc.).
When it copies over to a varchar field in my staging table it doesn't
come over as null, but it apparently isn't coming over as a space
either or anything of the '\s' variety. Below are the two ways I've
tried to use to convert what is incoming (which is either a letter to
convert to 'Yes' or whatever the empty thing is to convert to '').
1)
// Convert the CustomFieldString2 to 'Yes'/EMPTY.
if (isString(DTSSource("CustomFieldString2")))
{
custString2 = "Yes";
}
else
{
custString2 = "";
}
function isString(sStr)
{
try
{
return sStr.constructor==String;
}
catch(ex)
{
return false;
}
}
***now this one makes everything, whether it contains a letter or not
empty ('').
2)
if (DTSSource("CustomFieldString2") == "" |
DTSSource("CustomFieldString2") == null)
{
custString2 = "";
}
else
{
custString2 = "Yes";
}
***and this one makes everything 'Yes'.
plz help! i've tried everything I can think of, and yes I've also
previously tried adding *.replace(/\s/g,"") in various places to see if
that fixes it and no go =(. |