X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 626C8329E6A for ; Mon, 20 Sep 2004 23:53:13 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50648-01 for ; Mon, 20 Sep 2004 22:53:04 +0000 (GMT) Received: from smtp209.mail.sc5.yahoo.com (smtp209.mail.sc5.yahoo.com [216.136.130.117]) by svr1.postgresql.org (Postfix) with SMTP id 4C8F8329C67 for ; Mon, 20 Sep 2004 23:53:05 +0100 (BST) Received: from unknown (HELO ?192.168.200.3?) (fxjrlists@200.140.80.179 with plain) by smtp209.mail.sc5.yahoo.com with SMTP; 20 Sep 2004 22:53:03 -0000 Message-ID: <414F60C2.7030506@yahoo.com.br> Date: Mon, 20 Sep 2004 19:59:14 -0300 From: "Francisco Figueiredo Jr." User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "pgsql-jdbc@postgresql.org" Subject: Returning just one resultset from function call with refcursor return Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200409/129 X-Sequence-Number: 11019 Hi guys, I'd like to know how you are doing to return a cursor resultset from function call. I know, from documentation, that I can do the following: CREATE TABLE test (col text); INSERT INTO test VALUES ('123'); CREATE FUNCTION reffunc(refcursor) RETURNS refcursor AS ' BEGIN OPEN $1 FOR SELECT col FROM test; RETURN $1; END; ' LANGUAGE plpgsql; BEGIN; SELECT reffunc('funccursor'); FETCH ALL IN funccursor; COMMIT; The problem is that when I execute the lines above I get: reffunc ------------ funccursor (1 row) col ----- 123 (1 row) I'd like to omit the reffunc resultset return and get directly the col resultset. Is this possible? Thanks in advance. Please, let me know if this is not the appropriated place to do such questions. Regards, Francisco Figueiredo Jr.