Re: set return function is returning a single record, multiple - Mailing list pgsql-sql

From Alexis Paul Bertolini
Subject Re: set return function is returning a single record, multiple
Date
Msg-id 4451F56F.8030608@computer.org
Whole thread Raw
In response to set return function is returning a single record, multiple times,how can i get all the records in the table( description inside )  ("Penchalaiah P." <penchalaiahp@infics.com>)
List pgsql-sql
> 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


pgsql-sql by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: set return function is returning a single record, multiple times,how can i get all the records in the table( description inside )
Next
From: Emils
Date:
Subject: Outer joins?