Page 1 of 1

nvl equivalent in uvsh

Posted: Fri Jan 02, 2009 9:09 am
by tostay2003
Is there any nvl equivalent function to use in select queries of uvsh. Basically want to replace all null with an empty string.

Posted: Fri Jan 02, 2009 3:06 pm
by ray.wurlod

Code: Select all

EVAL "IF ISNULL(column) THEN '' ELSE column"

Posted: Fri Jan 02, 2009 5:18 pm
by mystuff
ray.wurlod wrote:

Code: Select all

EVAL "IF ISNULL(column) THEN '' ELSE column"
I have a similar usage in select query involving convert as well. Something like this

Code: Select all

select EVAL "CONVERT(@TM:@VM,'.', Field1,Field2,Field3) from H_TABLE;
If any of the fields is null then the output is null.

I applied the above null check condition.

Code: Select all

select EVAL "CONVERT(@TM:@VM,'.', If Isnull(Field1) then '' else Field1,If Isnull(Field2) then '' else Field2, If Isnull(Field3) then '' else Field3) from H_TABLE;
But, whenever Field2 is null, Field3 doesn't get displayed irrespective of whether it is null or not. I do get the output though i.e. only Field1 gets displayed with field seperators until Field2.

Posted: Fri Jan 02, 2009 10:25 pm
by ray.wurlod
This is unrelated to the original question. If you have a new question please begin a new thread.