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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgpl-problem, what's wrong with my loop?
Дата
Msg-id 28076.974738260@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pgpl-problem, what's wrong with my loop?  (Bruno Boettcher <bboett@erm1.u-strasbg.fr>)
Список 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 по дате отправления:

Предыдущее
От: Bruno Boettcher
Дата:
Сообщение: pgpl-problem, what's wrong with my loop?
Следующее
От: Kovacs Zoltan Sandor
Дата:
Сообщение: Re: pgpl-problem, what's wrong with my loop?