Problem with returning setof record

From: oliverp21(at)free(dot)fr
To: pgsql-sql(at)postgresql(dot)org
Subject: Problem with returning setof record
Date: 2004-09-07 17:13:14
Message-ID: 1094577194.413dec2a05bc4@imp1-q.free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

Here is a simple function I created for a test.

create function ttt() returns setof record as '
declare
r record;
begin
for r in select * from utilisateurs.menus loop
return next r;
end loop;
return;
end;
' language 'plpgsql';

When I try to use it, it returns to me :

select ttt();
set-valued function called in context that cannot accept a set
: PL/pgSQL function "ttt" line 5 at return next

Anyone has an idea ?

Best regards,
Patrice OLIVER

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2004-09-07 17:35:51 Re: Problem with returning setof record
Previous Message Andreas Joseph Krogh 2004-09-07 13:53:20 Re: Problem with LATIN1 characters from Perl-DBI