🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: debug stored procedures

#327
From: Craig Stuntz TeamB
Date: Tue, 20 May 2008 15:19
18 lines
2232 bytes
Isaac wrote:

> 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;

	There's not really a need to use COALESCE here. Since you're doing
this in a context of a stored procedure, you can check against NULL
after the query executes.

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
  Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Borland newsgroup denizen Sergio Gonz�lez has a new CD of 
  Irish music out, and it's good: http://tinyurl.com/7hgfr
Technical Details
Message-ID: <4832ec09$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!newsfeeder.dynfx.net!weretis.net!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> <4832e64f$1@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
From: "Craig Stuntz [TeamB]" <craig_stuntz@nospam.please [a.k.a. acm.org]>
Subject: Re: debug stored procedures
Newsgroups: borland.public.interbase.sql
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> <4832e64f$1@newsgroups.borland.com>
Organization: Vertex Systems Corporation
User-Agent: XanaNews/1.18.1.9
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ:0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 64.199.116.234
Message-ID: <4832ec09$1@newsgroups.borland.com>
Date: 20 May 2008 08:19:37 -0700
X-Trace: newsgroups.borland.com 1211296777 64.199.116.234 (20 May 2008 08:19:37 -0700)
Lines: 18
X-Authenticated-User: cstuntz
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!newsfeeder.dynfx.net!weretis.net!news.isoc.lu!newsgroups.borland.com!not-for-mail