nvl equivalent in uvsh

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

nvl equivalent in uvsh

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

Post by ray.wurlod »

Code: Select all

EVAL "IF ISNULL(column) THEN '' ELSE column"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

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

Post by ray.wurlod »

This is unrelated to the original question. If you have a new question please begin a new thread.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply