Re: Plpgsql function syntax error at first coalesce statement

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Jeff Ross <jross(at)wykids(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Plpgsql function syntax error at first coalesce statement
Date: 2010-04-25 20:09:39
Message-ID: 4BD4A183.3060303@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25/04/2010 20:50, Jeff Ross wrote:

> Now I'm *really* confused. I thought the table structure I created at
> the beginning of the function was where the results would be returned
> to. I tried a variety of queries including select into and create table
> but they didn't work either.

I think you have to do RETURN NEXT inside the loop:

create function....
declare
return_row record;
...
begin
...
for..
loop
select ... into return_row;
return next return_row;
end loop;
...
return;
end;

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-04-25 20:20:27 Re: Plpgsql function syntax error at first coalesce statement
Previous Message Jeff Ross 2010-04-25 19:50:49 Re: Plpgsql function syntax error at first coalesce statement