Stored procedures - Mailing list pgsql-sql

From beyaRecords - The home Urban music
Subject Stored procedures
Date
Msg-id 08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com
Whole thread Raw
Responses Re: Stored procedures
List pgsql-sql
Hi,
I am having problems with a stored procedure (plpgsql) that takes in a=20=
=20
value and returns a record set.
my code is as follow:

create function pg_clientRec(text) setof record as
'
declare
customerID ALIAS $1;
rec record;

begin
    select into rec * from troubletickets where custID =3D customerID;
    return rec;
end
'
language 'plpgsql';

I am calling the procedure as follows:

select clientRec('tmpg60');

I am getting the following error:

ERROR:=A0=A0set-valued=A0function=A0called=A0in=A0context=A0that=A0cannot=
=A0accept=A0a=A0set
CONTEXT:=A0=A0PL/=20
pgSQL=A0function=A0"pg_clientRec"=A0while=A0casting=A0return=A0value=A0to=
=A0function's=A0r=20
eturn=A0type

What am I doing wrong????


regards

Uzo=

pgsql-sql by date:

Previous
From: Adam Ruth
Date:
Subject: Re: postgreSQL editors
Next
From: Tom Lane
Date:
Subject: Re: Stored procedures