[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CONCAT behaviour.



Hi Oliver,

The COALESCE function is supported by Mckoi.  Your example expression 
can be translated as follows;

   CONCAT(this_val, COALESCE(that_val, ''))

Toby.

Oliver Jones wrote:
> Howdy folks.
> 
> I've been playing with the CONCAT() function in McKoi and noticed that
> if one of the arguments to Concat is NULL then the whole result is
> NULL.  This is fine.  Expected even given the behaviour of the ||
> (concat) operator in other databases.
> 
> However other databases such as PostgreSQL have functions like COALESCE
> (http://www.postgresql.org/idocs/index.php?functions-conditional.html)
> which allow you to do things like
> 
> this_val || COALESCE(that_val, '') 
> 
> Which concats that_val to this_val, but if that_val is null concat's an
> empty string (or whatever).
> 
> Helpfull if you want null values to be ignored.  
> 
> Now the question is, does McKoi have a similar function?
> 
> Regards