Re: Plpgsql function syntax error at first coalesce statement - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Plpgsql function syntax error at first coalesce statement
Date
Msg-id 4BD4A183.3060303@iol.ie
Whole thread Raw
In response to Re: Plpgsql function syntax error at first coalesce statement  (Jeff Ross <jross@wykids.org>)
List 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@iol.ie

pgsql-general by date:

Previous
From: Jeff Ross
Date:
Subject: Re: Plpgsql function syntax error at first coalesce statement
Next
From: Tom Lane
Date:
Subject: Re: Plpgsql function syntax error at first coalesce statement