From: beyaRecords - The home Urban music <uzo@beya-records.com>
To: pgsql-sql@postgresql.org
Subject: Stored procedures
Date: Fri, 2 Jan 2004 01:50:25 +0000
Message-ID: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com> (raw)
Hi,
I am having problems with a stored procedure (plpgsql) that takes in a
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 = customerID;
return rec;
end
'
language 'plpgsql';
I am calling the procedure as follows:
select clientRec('tmpg60');
I am getting the following error:
ERROR: set-valued function called in context that cannot accept a set
CONTEXT: PL/
pgSQL function "pg_clientRec" while casting return value to function's r
eturn type
What am I doing wrong????
regards
Uzo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: uzo@beya-records.com
Subject: Re: Stored procedures
In-Reply-To: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox