From: Kumar <sgnerd@yahoo.com.sg>
To: psql <pgsql-sql@postgresql.org>
Subject: Unnamed Cursor return
Date: Tue, 2 Sep 2003 14:31:40 +0530
Message-ID: <020001c37130$dcd632e0$7502a8c0@hdsc.com> (raw)
Dear Friends,
Using Postgres 7.3.4 on Linux 7.3 Server. Using PgAdmin II for Windows version 1.6.0 to connect to the server from my client machine.
CREATE FUNCTION selfn() RETURNS refcursor AS 'DECLARE
ref1 refcursor;
BEGIN
OPEN ref1 FOR
SELECT * FROM address;
RETURN ref1;
END;' LANGUAGE 'plpgsql' 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 executed, 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>" 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 Command prompt?
Please help me with this, as it is much helpful for my development purpose.
Regards
Kumar
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: sgnerd@yahoo.com.sg
Subject: Re: Unnamed Cursor return
In-Reply-To: <020001c37130$dcd632e0$7502a8c0@hdsc.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