How to fetch the RefCursor in via ODBC??

From: Harry Yau <harry(at)aurasound(dot)com(dot)hk>
To: harry(at)aurasound(dot)com(dot)hk, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: How to fetch the RefCursor in via ODBC??
Date: 2003-06-30 08:55:37
Message-ID: 3EFFFB08.7173C8F9@aurasound.com.hk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Wright 2003-06-30 11:25:05 weird quote bug
Previous Message Rajesh Kumar Mallah 2003-06-30 08:50:03 Re: Making pgsql error messages more developers' friendly.