Skip site navigation (1) Skip section navigation (2)

Re: Function problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oscar Chavarria" <cyberbuzzard(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Function problem
Date: 2007-04-09 15:04:37
Message-ID: 28076.1176131077@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
"Oscar Chavarria" <cyberbuzzard(at)gmail(dot)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

In response to

pgsql-novice by date

Next:From: kvnsmnsnDate: 2007-04-10 19:35:55
Subject: trying to connect to PostgreSQL
Previous:From: Stephan SzaboDate: 2007-04-09 14:32:13
Subject: Re: Function problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group