Page 1 of 1

concatination of stage variables

Posted: Wed Dec 13, 2006 7:42 pm
by sainath
Hi
I am using around 10 stage variables each have different if conditions
and i concatinate all stage variables and insert into a column.
like var1:var2------var10 into Name varchar2(288) field.

My problem is when i concatinate all variables i am getting null but if i test individually each result of variable it is working fine .
I want to know how can we solve this problem
thks

Posted: Wed Dec 13, 2006 7:56 pm
by ray.wurlod
The only way you'll get null from concatenation is if one of the operands is null. The individual expressions should not generate null if you're planning to concatenate. Generate "" or " " instead.

Posted: Wed Dec 13, 2006 7:59 pm
by narasimha
Couple of checkks

- Check for null before you concatenate.
- Replace nulls with a ' ' and check. You can figure out which stage variable is the culprit.

Posted: Wed Dec 13, 2006 8:00 pm
by johnthomas
I guess some of the link variables has value as NULL . Can you replace the null with some value and try out.

Posted: Wed Dec 13, 2006 8:01 pm
by I_Server_Whale
You must be getting one or more stage variables as NULL value which is causing the value of the whole expression to be NULL.

Try by starting with just two, then three and so on. This way you could find out which Stage variable is coming in as NULL.

Whale.

Posted: Wed Dec 13, 2006 8:07 pm
by I_Server_Whale
Wow...Too late :)

You can use the following DSTransforms for converting the NULL's

Code: Select all

NullToEmpty

        Or

NullToZero

Whale.

Posted: Wed Dec 13, 2006 8:48 pm
by chulett
NullToEmpty would be the proper choice in this case:

Code: Select all

NullToEmpty(var1):NullToEmpty(var2):  <etc>
No need for it on a field you know will never be null, but if there is any doubt...