X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 53425D1B432 for ; Fri, 2 Jan 2004 01:51:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 76528-03 for ; Thu, 1 Jan 2004 21:50:28 -0400 (AST) Received: from mta07-svc.ntlworld.com (mta07-svc.ntlworld.com [62.253.162.47]) by svr1.postgresql.org (Postfix) with ESMTP id 84BCED1B47C for ; Thu, 1 Jan 2004 21:50:24 -0400 (AST) Received: from [81.98.165.178] by mta07-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040102015027.GODU2588.mta07-svc.ntlworld.com@[81.98.165.178]> for ; Fri, 2 Jan 2004 01:50:27 +0000 Mime-Version: 1.0 (Apple Message framework v609) To: pgsql-sql@postgresql.org Message-Id: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com> Content-Type: multipart/alternative; boundary=Apple-Mail-5-211745130 From: beyaRecords - The home Urban music Subject: Stored procedures Date: Fri, 2 Jan 2004 01:50:25 +0000 X-Mailer: Apple Mail (2.609) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.2 tagged_above=0.0 required=5.0 tests=HTML_10_20, USER_AGENT_APPLEMAIL X-Spam-Level: * X-Archive-Number: 200401/1 X-Sequence-Number: 16394 --Apple-Mail-5-211745130 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed 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 --Apple-Mail-5-211745130 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 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 =3D customerID; return rec; end ' Courierlanguage 'plpgsql'; I am calling the procedure as follows: select clientRec('tmpg60'); I am getting the following error:=20 ArialE= RROR:=A0=A0set-valued=A0function=A0called=A0in=A0context=A0that=A0cannot=A0= accept=A0a=A0set CONTEXT:=A0=A0PL/pgSQL=A0function=A0"pg_clientR= ecArial"=A0while=A0casting=A0retur= n=A0value=A0to=A0function's=A0return=A0type What am I doing wrong???? regards Uzo --Apple-Mail-5-211745130--