X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9054C310E76 for ; Wed, 2 Jul 2003 09:27:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 26151-05 for ; Wed, 2 Jul 2003 06:27:16 -0300 (ADT) Received: from lx1.aurasound.com.hk (aworklan047152.netvigator.com [218.103.117.152]) by svr1.postgresql.org (Postfix) with ESMTP id 6375F310E77 for ; Wed, 2 Jul 2003 06:27:14 -0300 (ADT) Received: from aurasound.com.hk (lx1.aurasound.com.hk [218.103.117.152] (may be forged)) (authenticated bits=0) by lx1.aurasound.com.hk (8.12.9/8.12.9) with ESMTP id h629RCWx020545; Wed, 2 Jul 2003 17:27:12 +0800 Message-ID: <3F02A670.7AD731A0@aurasound.com.hk> Date: Wed, 02 Jul 2003 17:31:28 +0800 From: Harry Yau X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: zh MIME-Version: 1.0 To: Postgres ODBC Subject: How to fetch the RefCursor in via ODBC?? Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 7bit X-Archive-Number: 200307/9 X-Sequence-Number: 3070 Hi All, I wrote a function to return a RefCursor of a temp table as below: CREATE FUNCTION reffunc(refcursor, varchar(10), varchar(10)) RETURNS refcursor AS ' BEGIN EXECUTE ''create local temp table tablexxx (repno character(15), date date)''; insert into tablexxx (repno, date) VALUES ( $2, now() ); insert into tablexxx (repno, date) VALUES ( $3, now() ); OPEN $1 for EXECUTE '' SELECT * FROM tablexxx ''; RETURN $1; EXECUTE ''''; END; ' LANGUAGE 'plpgsql'; It work fine on psql, at least it work as I expected. I call this function by following command on psql: BEGIN; SELECT reffunc('funccursor', 'AAA', 'BBB' ); FETCH ALL FROM funccursor; COMMIT; However, when I try to call this function via ODBC ( namely in the Borland DBExplorer ). It got none information for me! I am wondoring is ODBC supporting RefCursor, since the FAQ of GBorg said the ODBC only support simple data type. Therefore, does ODBC support refcursor?? PS: My psqlODBC version is 07.03.0100 My psql version is 7.3.1 Harry Yau MIS HK