Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5682A9FC33E for ; Fri, 10 Aug 2007 02:57:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 28190-02 for ; Fri, 10 Aug 2007 02:57:46 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 084A39FC26E for ; Fri, 10 Aug 2007 02:57:47 -0300 (ADT) Received: (qmail 20366 invoked by uid 0); 10 Aug 2007 05:57:46 -0000 Received: from 84.75.95.14 by www054.gmx.net with HTTP; Fri, 10 Aug 2007 07:57:46 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" Date: Fri, 10 Aug 2007 07:57:46 +0200 From: "Christian Kindler" Message-ID: <20070810055746.206080@gmx.net> MIME-Version: 1.0 Subject: Returnd Refcurser ( not fetchable To: pgsql-sql@postgresql.org X-Authenticated: #27759442 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+rtmsSgRWr6k6fZqlKlnkyx9scTFMVOytTwgM5cl f0yVH78iJHRGl2Qbuf4NxkZAm8SDSbxAGMrQ== Content-Transfer-Encoding: 7bit X-GMX-UID: YsyIcuoZX1V6Gmb+y2Byvd1/SDc4NIww X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200708/69 X-Sequence-Number: 29007 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 ''; ERROR: syntax error at or near "''" 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