Re: Function problem - Mailing list pgsql-novice

From Tom Lane
Subject Re: Function problem
Date
Msg-id 28076.1176131077@sss.pgh.pa.us
Whole thread Raw
In response to Function problem  ("Oscar Chavarria" <cyberbuzzard@gmail.com>)
List pgsql-novice
"Oscar Chavarria" <cyberbuzzard@gmail.com> writes:
> DECLARE
> yield_rows investments%rowtype;
> ...
> FOR yield_rows IN SELECT * FROM investments
> LOOP
> sum_returns:=
>
investments.return1+investments.return2+investments.return3+investments.return4+investments.return5+investments.return6+investments.return7;

I think you want "yield_rows" not "investments" here, no?

> *ERROR: missing FROM-clause entry for table "investments"*

Also, you should have gotten a more specific error message than that.
Wasn't there a "context" line telling you exactly which line of the
function contained the problem?

            regards, tom lane

pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Function problem
Next
From: marcofuics@netscape.net
Date:
Subject: prepared statements logging