From: | "Christian Kindler" <christian(dot)kindler(at)gmx(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Returnd Refcurser (<unnamed portal x> not fetchable |
Date: | 2007-08-10 05:57:46 |
Message-ID: | 20070810055746.206080@gmx.net |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Penchalaiah P. | 2007-08-10 06:05:20 | Re: Returnd Refcurser (<unnamed portal x> not fetchable |
Previous Message | Gregory Stark | 2007-08-10 03:10:47 | Re: PG won't use index on ORDER BY <expression> |