Re: pgpl-problem, what's wrong with my loop?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Boettcher <bboett(at)erm1(dot)u-strasbg(dot)fr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: pgpl-problem, what's wrong with my loop?
Date: 2000-11-20 16:37:40
Message-ID: 28076.974738260@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruno Boettcher <bboett(at)erm1(dot)u-strasbg(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kovacs Zoltan Sandor 2000-11-20 17:06:52 Re: pgpl-problem, what's wrong with my loop?
Previous Message Bruno Boettcher 2000-11-20 16:21:05 pgpl-problem, what's wrong with my loop?