NVL()

From Recital Documentation Wiki
Revision as of 10:49, 23 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Class

Expressions and Type Conversion


Purpose

Function to specify an alternative value for a null expression


Syntax

NVL(<expr1>,<expr2>)


See Also

ETOS(), ISNULL(), SET NULL


Description

The NVL() function evaluates the expression in <expr1>, and if the expression does not evaluate to NULL, the evaluated result is returned. If the expression in <expr1> does evaluate to NULL, the expression in <expr2> is evaluated. If <expr2> does not evaluate to NULL, the evaluated result is returned. If both <expr1> and <expr2> evaluate to NULL, the NVL() function returns NULL.


Example

set sql to vfp
set null on
CREATE TABLE nullon (firstname c(20), lastname c(20))
INSERT INTO nullon (lastname) VALUES ("Smith")
SELECT lastname, nvl(firstname,"Unknown") from nullon


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer