"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