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 AF835D1B8A5 for ; Tue, 2 Sep 2003 09:02:14 +0000 (GMT) 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 37198-10 for ; Tue, 2 Sep 2003 06:01:44 -0300 (ADT) Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by svr1.postgresql.org (Postfix) with SMTP id E0F5FD1B550 for ; Tue, 2 Sep 2003 06:01: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; 2 Sep 2003 09:01:41 -0000 Message-ID: <020001c37130$dcd632e0$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: Unnamed Cursor return Date: Tue, 2 Sep 2003 14:31:40 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01FB_01C3715E.EC86AF20" 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-Archive-Number: 200309/5 X-Sequence-Number: 14983 This is a multi-part message in MIME format. ------=_NextPart_000_01FB_01C3715E.EC86AF20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Friends, Using Postgres 7.3.4 on Linux 7.3 Server. Using PgAdmin II for Windows vers= ion 1.6.0 to connect to the server from my client machine. CREATE FUNCTION selfn() RETURNS refcursor AS 'DECLARE=20 ref1 refcursor; BEGIN OPEN ref1 FOR=20 SELECT * FROM address; RETURN ref1; END;' LANGUAGE 'plpgsql' VOLATILE; this works fine.=20 I execute it at PgAdmin SELECT selfn();=20 an unnamed cursor is returned. fetch all from ""; at PgAdmin shows a popup window saying the query is executed, but the conte= nt is not shown. at command prompt SELECT selfn(); an unnamed cursor is returned. fetch all from ""; WARNING: PerformPortalFetch: portal "" not found FETCH 0 (1) pls have a look in the function, that I have named the cursor as ref1, = but again it is returning a unnamed cursor? (2) How to fetch the content of the unnamed cursor at PgAdmin and at Comman= d prompt? Please help me with this, as it is much helpful for my development purpose. Regards Kumar ------=_NextPart_000_01FB_01C3715E.EC86AF20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Friends,
 
Using Postgres 7.3.4 on Linux 7.3 Server. Using PgAdmin= II for=20 Windows version 1.6.0 to connect to the server from my client=20 machine.
 
CREATE FUNCTION selfn() RETURNS refcursor AS 'DECLARE <= BR>ref1=20 refcursor;
BEGIN
OPEN ref1 FOR
SELECT *  FROM=20 address;
RETURN ref1;
END;'  LANGUAGE 'plpgsql'=20 VOLATILE;
 
this works fine. 
I execute it at PgAdmin
 
SELECT selfn();
an unnamed cursor is returned.
fetch all from  "<unnamed cursor 2 >";
at PgAdmin shows a popup window saying the query is exe= cuted,=20 but the content is not shown.
 
at command prompt
SELECT selfn();
an unnamed cursor is returned.
fetch all from  "<unnamed cursor 2 >";
WARNING:  PerformPortalFetch: portal "<unnamed cursor 1>" n= ot=20 found
FETCH 0
 
(1) pls have a look in the function, that I have named the cursor as r= ef1,=20 but again it is returning a unnamed cursor?
 
(2) How to fetch the content of the unnamed cursor at PgAdmin and at= =20 Command prompt?
 
 
Please help me with this, as it is much helpful for my development=20 purpose.
 
Regards
Kumar

------=_NextPart_000_01FB_01C3715E.EC86AF20--