meta data for this page
  •  

ibec_Coalesce

Description

The ibec_Coalesce function is similar to the Firebird COALESCE functions. It takes two or more arguments and returns the value of the first non-NULL argument. If all the arguments evaluate to NULL, NULL is returned.

The evaluation of input expressions stops as soon as the result of the entire expression becomes evident in left to right order of evaluation.

Syntax

 function ibec_Coalesce(Val1 : variant; Val2 : variant; [Val2 : variant; ...]) ; variant;

Example 1

execute ibeblock 
returns (_Coalesce varchar(255))
as
begin
 _Coalesce = ibec_Coalesce('Nickname', 'FirstName', 'Mr./Mrs.');
 suspend;
end 

Example 2

execute ibeblock 
returns (_Coalesce varchar(255))
as
begin
 _Coalesce = ibec_Coalesce(NULL, 'FirstName', 'Mr./Mrs.');
 suspend;
end  

Example 3

execute ibeblock 
returns (_Coalesce varchar(255))
as
begin
 _Coalesce = ibec_Coalesce(NULL, NULL, 'Mr./Mrs.');
 suspend;
end