Article View: borland.public.interbase.sql
Article #298Re: trigger to get sum
From: Bill Todd [TeamB]
Date: Sun, 18 May 2008 00:57
Date: Sun, 18 May 2008 00:57
17 lines
1472 bytes
1472 bytes
The code below shows the correct syntax for the SELECT statment. What
do the ? and ?? in the WHERE clauses represent? Are you going to pass
these values in as input parameters? You might find it helpful to read
the chapters on stored procedures and triggers in the Data Definition
Guide.
AS
DECLARE VARIABLE sum_var float;
begin
select sum(f2) from table_a
where f1 = ? into :sum_var;
update table_b set fb2 = sum_var where fb1 = ??;
end
--
Bill Todd (TeamB)
Technical Details
Message-ID:
<482f7efc@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<482f63f1$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,c564685cdb1305db
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd [TeamB]" <no@no.com>
Subject: Re: trigger to get sum
Newsgroups: borland.public.interbase.sql
References: <482f63f1$1@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.9
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 76.208.40.243
Message-ID: <482f7efc@newsgroups.borland.com>
Date: 17 May 2008 17:57:32 -0700
X-Trace: newsgroups.borland.com 1211072252 76.208.40.243 (17 May 2008 17:57:32 -0700)
Lines: 17
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail