X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id BA660D1B91E for ; Wed, 27 Aug 2003 04:19:12 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 20625-08 for ; Wed, 27 Aug 2003 04:18:43 -0300 (ADT) Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58]) by svr1.postgresql.org (Postfix) with SMTP id 54927D1B954 for ; Wed, 27 Aug 2003 04:18:41 -0300 (ADT) Received: from ptil-138-190-chn.primus-india.net (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 27 Aug 2003 07:18:41 -0000 Message-ID: <006901c36c6b$65ab2000$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: How to return a record set from function. Date: Wed, 27 Aug 2003 12:48:15 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0066_01C36C99.7BA62CF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=HTML_50_60, HTML_FONT_COLOR_BLUE X-Spam-Level: X-Archive-Number: 200308/316 X-Sequence-Number: 14932 This is a multi-part message in MIME format. ------=_NextPart_000_0066_01C36C99.7BA62CF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Friends, I am newbie to Postgres. I am running 7.3.4 on Linux 7.3. I am using Pgadmi= n tool. I need to return the table rows via record set. Create table t1 (c1 int, c2 varchar, c3 varchar); Create or Replace function sel_t1 () returns setof records as ' select c1, c2, c3 from t1; ' Language SQL; It was fine and created a function. while i execute it as select sel_t1;=20 I got the following error. ERROR: Cannot display a value of type RECORD How to solve this. Please help. Kumar ------=_NextPart_000_0066_01C36C99.7BA62CF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Friends,
 
I am newbie to Postgres. I= am running=20 7.3.4 on Linux 7.3. I am using Pgadmin tool. I need to return the table row= s via=20 record set.
 
Create table t1 (c1 int, c= 2 varchar,=20 c3 varchar);
 
Create or Replace function= sel_t1 ()=20 returns setof records as '
select c1, c2, c3 from=20 t1;
' Language SQL;
 
It was fine and created a = function.=20 while i execute it as
 
select sel_t1;
 
 I got the following= =20 error.
 
ERROR:  Cannot displa= y a value=20 of type RECORD
 
How to solve this. Please= =20 help.
 
Kumar
<= /HTML> ------=_NextPart_000_0066_01C36C99.7BA62CF0--