From: Harry Yau <harry@aurasound.com.hk>
To: Postgres ODBC <pgsql-odbc@postgresql.org>
Subject: How to fetch the RefCursor in via ODBC??
Date: Wed, 02 Jul 2003 17:31:28 +0800
Message-ID: <3F02A670.7AD731A0@aurasound.com.hk> (raw)
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: harry@aurasound.com.hk
Subject: Re: How to fetch the RefCursor in via ODBC??
In-Reply-To: <3F02A670.7AD731A0@aurasound.com.hk>
References: <3F02A670.7AD731A0@aurasound.com.hk>
* 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