Re: Function problem

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Function problem
Дата
Msg-id 20070409072749.M4827@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Function problem  ("Oscar Chavarria" <cyberbuzzard@gmail.com>)
Список pgsql-novice
On Mon, 9 Apr 2007, Oscar Chavarria wrote:

> I would appreciate and thank in advance any help to understand the error
> message I receive when I try to run this function. The function is initially
> accepted with no errors of syntax.
>
>
> CREATE OR REPLACE FUNCTION returns_todate(integer)
>
> RETURNS numeric AS
>
> $BODY$
>
> DECLARE
>
> yield_rows investments%rowtype;
>
> counter integer;
>
> sum_returns numeric;
>
> BEGIN
>
> FOR yield_rows IN SELECT * FROM investments
>
> LOOP
>
> sum_returns:=
> investments.return1+investments.return2+investments.return3+
> investments.return4+investments.return5+investments.return6+
> investments.return7
> ;

My guess is that these should probably be yield_rows.<whatever> since
yield_rows is the variable name rather than using the table name.

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Oscar Chavarria"
Дата:
Сообщение: Function problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Function problem