Re: [GENERAL] coalesce for null AND empty strings

2007-04-02 Thread Ferdinand Gassauer
On Friday 30 March 2007 10:19:35 Richard Huxton wrote: > Don't forget to cc: the list! snip > > OK this shortens the function, but does not help to "solve" the coalesce > > problem > > coalecse(empty2null(var1),empty2null(var2),empty2null(var-n)) > > instead of > > coalecse2(var1,var2,...var-

Re: [GENERAL] coalesce for null AND empty strings

2007-04-02 Thread Lew
Ferdinand Gassauer wrote: * looking through Google it IS a concern for many others and thus this function should be distributed as default. The mere fact that something is requested does not imply that the request should be accepted. I'm sure there's a name for this fallacy, but I can't think

Re: [GENERAL] coalesce for null AND empty strings

2007-04-02 Thread Lew
Ferdinand Gassauer wrote: it would be great to have a coalesce2 function which treats empty strings as null values. I disagree, it would be the opposite of "great". "" is a /known/ value and not in the same semantic space as NULL at all. If you really feel you need such a function, though, w

Re: [GENERAL] coalesce for null AND empty strings

2007-03-30 Thread Richard Huxton
Ferdinand Gassauer wrote: On Friday 30 March 2007 10:19:35 Richard Huxton wrote: Don't forget to cc: the list! snip OK this shortens the function, but does not help to "solve" the coalesce problem coalecse(empty2null(var1),empty2null(var2),empty2null(var-n)) instead of coalecse2(var1,var

Re: [GENERAL] coalesce for null AND empty strings

2007-03-30 Thread Alban Hertroys
Ferdinand Gassauer wrote: > Hi! > > it would be great to have a coalesce2 function which treats empty strings as > null values. I think COALESCE(NULLIF(value1, ''), value2) does what you want. You could wrap that in a new function coalesce2 if you like. -- Alban Hertroys [EMAIL PROTECTED]

Re: [GENERAL] coalesce for null AND empty strings

2007-03-30 Thread Richard Huxton
Don't forget to cc: the list! Ferdinand Gassauer wrote: Am Freitag, 30. März 2007 schrieben Sie: Ferdinand Gassauer wrote: Hi! it would be great to have a coalesce2 function which treats empty strings as null values. Why? What is the use-case for this? as far as I have seen, there are a lo

Re: [GENERAL] coalesce for null AND empty strings

2007-03-29 Thread Richard Huxton
Ferdinand Gassauer wrote: Hi! it would be great to have a coalesce2 function which treats empty strings as null values. Why? What is the use-case for this? as far as I have seen, there are a lot of comments and coding solutions about this, but none is an "easy" one and all make the code a b

[GENERAL] coalesce for null AND empty strings

2007-03-29 Thread Ferdinand Gassauer
Hi! it would be great to have a coalesce2 function which treats empty strings as null values. as far as I have seen, there are a lot of comments and coding solutions about this, but none is an "easy" one and all make the code a bit more complicated and more difficult to maintain. I have creat