Re: Oracle NVL equivalent ?
Posted in 1997
Try with:
create procedure notnull(nold decimal(13,2),nnew decimal(13,2))
returning decimal(13,2); if nold is null then
let nold=nnew;
end if;
return nold;
end procedure
Create this procedure in your database, and now use!
Example:
select notnull(a,"0")
from tabla
or
CREATE PROCEDURE nvl_integer(v1 INTEGER, v2 INTEGER DEFAULT 0)
RETURNING INTEGER; DEFINE rv INTEGER;
IF v1 IS NOT NULL THEN
LET rv = v1;
ELSE
LET rv = v2;
END IF
RETURN rv;
END PROCEDURE;
-----Message d'origine-----
De : Vince Nichols <vnichols@sprynet.com>
' : informix-list@rmy.emory.edu <informix-list@rmy.emory.edu>
Date : jeudi 18 d'cembre 1997 01:54
Objet : Re: Oracle NVL equivalent ?
}Peter Robinson wrote:
}
}> Hi,
}> We are currently porting one of our applications to
}> unix/informix HP 9.04/online 6 from NT/Oracle 7
}>
}> We currently use NVL to return a value (0) in place of a null in a
}> select statement. Is there any equivalent in Informix?
}> --
}> Peter Robinson
}> Dulce et Decorum est pro Microsoft Mori
}
} Peter,
}
}Go to http://www.iiug.org/software/software_index.html and download the
}orclproc stored procedures.
}
}--
}Vince Nichols
}Certified Informix Database Specialist
}Dallas, Texas
}mailto://vnichols@sprynet.com
}Work: (972) 918-6602
}Home: (972) 414-5405
}http://www.thegifthorse.com
}mailto://webmaster@thegifthorse.com
}
}
}