Page 1 of 1

NVL in Server jobs?

Posted: Wed Jan 24, 2007 6:16 pm
by dsdoubt
Hi,

Is there any functions available like NVL(input,'x'). ie., to return first non null value. Similar to NullToValue() in PX. Or If..Then...Else is the only case?

Posted: Wed Jan 24, 2007 6:22 pm
by narasimha
You have a NullToEmpty and NullToZero.
You can extend that to get what you want.

Posted: Wed Jan 24, 2007 7:39 pm
by ray.wurlod
You'll find these as Transforms, rather than as Routines. Create your own NullToValue transform in the same category. Of course, it will need two arguments, not one.

Posted: Wed Jan 24, 2007 8:03 pm
by I_Server_Whale
Expanding on Ray's answer. Create a new transform 'NullToValue' with two input arguments, Arg1 and Arg2, where Arg1 is your input and Arg2 is the value if input is NULL. Put this code in the "Definition" field.

Code: Select all

(IF ISNULL(%Arg1%) THEN %Arg2% ELSE %Arg1%)
Whale.[/i]

Posted: Wed Jan 24, 2007 9:29 pm
by DSguru2B
You can also incorporate Len(in.Col) < 1 in Whale's code to handle source files.