🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #7

Re: debug stored procedures

#7
From: Quinn Wildman (CodeGear Develope...
Date: Tue, 20 May 2008 22:49
20 lines
1734 bytes
I don't understand why you even need coalesce here. NULL's do not effect 
SUM. Let's consider a trivial example

create table t1 (f1 float);
insert into t1 values (NULL);
insert into t1 values (1.2);
insert into t1 values (2.3);

Now, we know that NULL + 1.2 + 2.3 = NULL. However, select sum(f1) from 
t1 returns 3.5. Isn't that what you want?

Isaac wrote:
> I think I found another bug or a defect that I cant use SUM with COALESCE
> 
> I tried SUM(COALESCE(QTY, cast(0 AS FLOAT)))
> 
> and get this error:
> Unsuccessful execution caused by system error that does not preclude 
> successful execution of subsequent statements.
> data type not supported for arithmetic.
Technical Details
Message-ID: <483355b3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4831f162@newsgroups.borland.com> <483340f3$1@newsgroups.borland.com> <4833500a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,8feff649be448d0
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 20 May 2008 15:49:26 -0700
From: "Quinn Wildman (CodeGear Developer Support)" <qwildman@nospam.codegear.com>
User-Agent: Thunderbird 1.5.0.14 (Windows/20071210)
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: Re: debug stored procedures
References: <4831f162@newsgroups.borland.com> <483340f3$1@newsgroups.borland.com> <4833500a@newsgroups.borland.com>
In-Reply-To: <4833500a@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 10.143.100.209
Message-ID: <483355b3$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1211323827 10.143.100.209 (20 May 2008 15:50:27 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail