pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Kindler <christian.kindler@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Returnd Refcurser (<unnamed portal x> not fetchable
Date: Fri, 10 Aug 2007 07:57:46 +0200
Message-ID: <20070810055746.206080@gmx.net> (raw)

Hi!

I have the Problem, that a function returns a refcursor and I am not able to fetch them. I tried in several ways. 

Can you please tell me how to get the cursor data.

Thanks 
Chris

PS this is what I have:

create table foo(sirname text, name text);
insert into foo values ('Mueller', 'Marcus');

create function getfoo(char(1)) returns refcursor as
'
declare 
   ref refcursor;

begin
   open ref for select * from foo where sirname like ''%'' || $1 || ''%'';
   return ref;
end;   
'
LANGUAGE 'plpgsql' VOLATILE;

select * from getfoo('M');
* fetch all in '<unnamed portal 11>';

ERROR:  syntax error at or near "'<unnamed portal 11>'" at character 14

-- 
cu
Chris

GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail



view thread (6+ messages)  latest in thread

Message-ID: <20070810055746.206080@gmx.net>
Permalink:  ../20070810055746.206080@gmx.net/
Also on:    postgresql.org/message-id/20070810055746.206080@gmx.net

 · 

reply

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: christian.kindler@gmx.net
  Subject: Re: Returnd Refcurser (<unnamed portal x> not fetchable
  In-Reply-To: <20070810055746.206080@gmx.net>

* 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