Function Coalesce() Foundation
Returns the first non NIL/NULL expression among its arguments.
Coalesce( <Expression,...> ) --> <Expression>
Returns the first non NIL/NULL value of its arguments evaluated from the left to the right most parameter passed. If all expressions evaluate to NIL the function returns NIL.
The function Coalesce() is used to determine the first valid value of a set of values. Instead of using the function Coalesce() the programmer can use IF/ELSEIF statements. However using nested IF statements in database expressions is not possible.
Furthermore the function Coalesce() is supported by many database management systems which facilitate business logic to be more efficient. It is considered good practice using Coalesce() or CoalesceEmpty() instead of writing IIF() in database expressions, specifically if Xbase++ applications accessing SQL database systems are developed.
The function Coalesce() is often used to substitute a default value for NULL/NIL values when data is displayed, for example:
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.