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

CONCAT behaviour.



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
--
Oliver Jones > Senior Software Engineer > Deeper Design Limited.
oliver@deeper.co.nz  > www.deeperdesign.com > +64 (21) 41-2238