🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: debug stored procedures

#325
From: Isaac
Date: Tue, 20 May 2008 14:54
30 lines
2316 bytes
Bill Todd [TeamB] wrote:
> Sorry. I did not scroll down far enough to see that you had replied to
> one of your earlier messages.
> 
> Apparently you cannot use COALESCE in two SUM aggregates in the same
> SELECT. Try running
> 
> select COALESCE(sum(QTY),0) from purchase_inv_item
>    left outer join purchase_inv on (purchase_inv_item.pur_code =
> purchase_inv.pur_code)
>     where (purchase_inv.purch_return <> 1)
>       and (PURCHASE_INV_ITEM.item_code = :p_new_item_code)
>       and (PURCHASE_INV_ITEM.inv_code = :p_new_inv_code)
> 
> in isql after replacing the parameters with literal values and see if
> you still get an error.
> 

news sql

select COALESCE(sum(QTY),0) from purchase_inv_item
     left outer join purchase_inv on (purchase_inv_item.pur_code = 
purchase_inv.pur_code)
     where (purchase_inv.purch_return <> 1)
       and (PURCHASE_INV_ITEM.item_code = :p_new_item_code)
       and (PURCHASE_INV_ITEM.inv_code = :p_new_inv_code)
       into :pur_sum_qty;

result: same error -902 !! the error also appear without using sum at 
all !!! is that a bug ?
Technical Details
Message-ID: <4832e64f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <4831f162@newsgroups.borland.com> <4831f280@newsgroups.borland.com> <4831f42a@newsgroups.borland.com> <483201d3$1@newsgroups.borland.com> <48321ed5$1@newsgroups.borland.com> <4832c323@newsgroups.borland.com> <4832cc01@newsgroups.borland.com> <4832d6a0$1@newsgroups.borland.com> <4832e3e1@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 17:54:49 +0300
From: Isaac <no@no.com>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: Re: debug stored procedures
References: <4831f162@newsgroups.borland.com> <4831f280@newsgroups.borland.com> <4831f42a@newsgroups.borland.com> <483201d3$1@newsgroups.borland.com> <48321ed5$1@newsgroups.borland.com> <4832c323@newsgroups.borland.com> <4832cc01@newsgroups.borland.com> <4832d6a0$1@newsgroups.borland.com> <4832e3e1@newsgroups.borland.com>
In-Reply-To: <4832e3e1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 41.234.198.61
Message-ID: <4832e64f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1211295311 41.234.198.61 (20 May 2008 07:55:11 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail