Oracle build in function NVL() also in informix?
Posted in 1999
Topics: General Discussion
Hi, in oracle something is possible: select nvl(column_xyz, 'ABC') from table_xyz ... It results 'ABC' when the value of column_xyz in current row is null and the current value if column_xyz is not null. Exists something which is equivalent in informix ?
In article <3833DB4C.FF0A91F0@quantum.de>, Werner Franke <franke@quantum.de> wrote: > Hi, > in oracle something is possible: > select nvl(column_xyz, 'ABC') from table_xyz ... > It results 'ABC' when the value of column_xyz in current row is null and > the current value if column_xyz is not null. > Exists something which is equivalent in informix ? > > Yes, starting from 7.3x Check conditional expressions in SQL Syntax Guide, NVL, DECODE, CASE. -- Vardan Aroustamian vaar@geocities.com Sent via Deja.com http://www.deja.com/ Before you buy.
Hi Werner,
create your own NVL Procedure like this for decimal:
CREATE PROCEDURE NVL(wert DECIMAL, default DECIMAL)
RETURNING DECIMAL; IF wert IS NULL THEN
LET wert = default;
END IF
RETURN wert;
END PROCEDURE;
Dirk
Werner Franke schrieb:
> Hi,
> in oracle something is possible:
> select nvl(column_xyz, 'ABC') from table_xyz ...
> It results 'ABC' when the value of column_xyz in current row is null and
> the current value if column_xyz is not null.
> Exists something which is equivalent in informix ?