COALESCEC Function

Returns the first non-null or nonmissing value from a list of character arguments.

Category: Character
Returned data type: NCHAR

Syntax

COALESCEC(expression[, ...expression])

Arguments

expression

specifies any valid expression that evaluates to a character value.

Data type NCHAR
See <sql-expression>
FedSQL Expressions.

Details

COALESCEC accepts one or more character expressions. The COALESCEC function checks the value of each expression in the order in which they are listed and returns the first non-null or nonmissing value. If only one value is listed, then the COALESCEC function returns the value of that expression. If all the values of all expressions are null or missing, then the COALESCEC function returns a null or missing value depending on whether you are in ANSI mode or SAS mode. For more information, see How FedSQL Processes Nulls and SAS Missing Values.

Comparisons

The COALESCEC function searches character expressions, whereas the COALESCE function searches numeric expressions.

Example

The following statements illustrate the COALESCEC function:
Statements
Results
select coalescec('', 'Hello');
Hello
select coalescec('', 'Goodbye', 'Hello');
Goodbye

See Also

Functions: