On Mon, Mar 14, 2005 at 04:50:38PM +0100, Raphael Bauduin wrote:
> for r in EXECUTE ''select customer_id from customers'' loop
If the query is static (i.e., not generated) and you're not working
with a temporary table, then you can omit EXECUTE:
FOR r IN SELECT customer_id FROM customers LOOP
The function might benefit from using a cached plan in this case.
> select GetRows();
>
> I get this error:
>
> ERROR: set-valued function called in context that cannot accept a set
> CONTEXT: PL/pgSQL function "getrows" line 5 at return next
It should be:
SELECT * FROM GetRows();
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/