From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Boettcher <bboett@erm1.u-strasbg.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: pgpl-problem, what's wrong with my loop?
Date: Mon, 20 Nov 2000 11:37:40 -0500
Message-ID: <28076.974738260@sss.pgh.pa.us> (raw)
In-Reply-To: <20001120172105.E25191@erm1.u-strasbg.fr>
References: <20001120165133.D25191@erm1.u-strasbg.fr>
<20001120172105.E25191@erm1.u-strasbg.fr>
Bruno Boettcher <bboett@erm1.u-strasbg.fr> writes:
> CREATE FUNCTION accSum(text,text) RETURNS int4 AS '
> DECLARE
> col ALIAS FOR $1;
> sumup ALIAS FOR $2;
> ...
> FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP
Looks like the WHERE condition is testing for equality between the two
parameters of the function. Since evidently that wasn't what you meant
to do, perhaps you'd be well advised to choose local-variable names that
don't conflict with column names of your tables...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, bboett@erm1.u-strasbg.fr
Subject: Re: pgpl-problem, what's wrong with my loop?
In-Reply-To: <28076.974738260@sss.pgh.pa.us>
References: <20001120165133.D25191@erm1.u-strasbg.fr> <20001120172105.E25191@erm1.u-strasbg.fr> <28076.974738260@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox