> CREATE or replace FUNCTION ftoc9() RETURNS setof structrankmaster2
> LANGUAGE 'plpgsql'
>
> AS' DECLARE
>
> rowdata pss%rowtype;
>
> BEGIN for i in 1..3 loop
>
> select * into rowdata from pss ;
>
> return next rowdata ;
>
> end loop;
>
> return;
>
> end';
>
The query should be outside the loop, otherwise you are re-running the
query each time :-)
Alex