You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Robert Enyedi <ro...@intland.com> on 2006/08/29 15:13:41 UTC

Derby support for COALESCE

Hi,

How does Derby support the COALESCE function? While the reference manual 
briefly mentions that this is a reserved word and there is SQLSTATE 
42610 related to it, it does not get into details. The function seems to 
work but (in a certain scenario which I did not identify yet) it 
produces a server side NullPointerException.

The functionality of COALESCE(x1, x2, x3, ...) returns the first item 
from the list which is not null.

Is COALESCE supported in Derby or is there a well documented alternative 
function which does the same thing?

Regards,
Robert

Re: Derby support for COALESCE

Posted by Kristian Waagan <Kr...@Sun.COM>.
Robert Enyedi wrote:
> I already found the answer to this here: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200508.mbox/%3C1495151979.1123569755774.JavaMail.jira@ajax.apache.org%3E 
> 
> 
> The scenario in which I get a NullPointerException when using COALESCE 
> has been reported here: http://issues.apache.org/jira/browse/DERBY-1774

Hi,

I have updated this Jira with a little more information.

The problem seems to be fixed in trunk, but not in the latest snapshot.
I'll ask on the developer list if anyone remember having done some work 
in this area lately. We might be able to get the fix into 10.2.



Regards,
-- 
Kristian

> 
> I would appreciate any suggestions on how to avoid this bug.
> 
> Regards,
> Robert
> 
> Robert Enyedi wrote:
>> Hi,
>>
>> How does Derby support the COALESCE function? While the reference 
>> manual briefly mentions that this is a reserved word and there is 
>> SQLSTATE 42610 related to it, it does not get into details. The 
>> function seems to work but (in a certain scenario which I did not 
>> identify yet) it produces a server side NullPointerException.
>>
>> The functionality of COALESCE(x1, x2, x3, ...) returns the first item 
>> from the list which is not null.
>>
>> Is COALESCE supported in Derby or is there a well documented 
>> alternative function which does the same thing?
>>
>> Regards,
>> Robert
>>
> 


Re: Derby support for COALESCE

Posted by Robert Enyedi <ro...@intland.com>.
I already found the answer to this here: 
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200508.mbox/%3C1495151979.1123569755774.JavaMail.jira@ajax.apache.org%3E

The scenario in which I get a NullPointerException when using COALESCE 
has been reported here: http://issues.apache.org/jira/browse/DERBY-1774

I would appreciate any suggestions on how to avoid this bug.

Regards,
Robert

Robert Enyedi wrote:
> Hi,
>
> How does Derby support the COALESCE function? While the reference 
> manual briefly mentions that this is a reserved word and there is 
> SQLSTATE 42610 related to it, it does not get into details. The 
> function seems to work but (in a certain scenario which I did not 
> identify yet) it produces a server side NullPointerException.
>
> The functionality of COALESCE(x1, x2, x3, ...) returns the first item 
> from the list which is not null.
>
> Is COALESCE supported in Derby or is there a well documented 
> alternative function which does the same thing?
>
> Regards,
> Robert
>