Re: Function problem

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Oscar Chavarria <cyberbuzzard(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Function problem
Date: 2007-04-09 14:32:13
Message-ID: 20070409072749.M4827@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-04-09 15:04:37 Re: Function problem
Previous Message Oscar Chavarria 2007-04-09 14:16:10 Function problem