Re: pgpl-problem, what's wrong with my loop? - Mailing list pgsql-sql

From Tom Lane
Subject Re: pgpl-problem, what's wrong with my loop?
Date
Msg-id 28076.974738260@sss.pgh.pa.us
Whole thread Raw
In response to pgpl-problem, what's wrong with my loop?  (Bruno Boettcher <bboett@erm1.u-strasbg.fr>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Bruno Boettcher
Date:
Subject: pgpl-problem, what's wrong with my loop?
Next
From: Kovacs Zoltan Sandor
Date:
Subject: Re: pgpl-problem, what's wrong with my loop?