Re: ODBC driver and refcursors

From: Farooq <shorrt_circuit(at)yahoo(dot)com>
To: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: ODBC driver and refcursors
Date: 2009-06-02 10:18:48
Message-ID: 292014.19591.qm@web45106.mail.sp1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

--- On Tue, 6/2/09, Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp> wrote:

> From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
> Subject: Re: [ODBC] ODBC driver and refcursors
> To: "Farooq" <shorrt_circuit(at)yahoo(dot)com>
> Cc: pgsql-odbc(at)postgresql(dot)org
> Date: Tuesday, June 2, 2009, 8:39 AM
> Farooq wrote:
> > Any ideas? Anyone?
> >
> > --- On Thu, 5/28/09, Farooq <shorrt_circuit(at)yahoo(dot)com>
> wrote:
> >
> >> From: Farooq <shorrt_circuit(at)yahoo(dot)(dot)com>
> >> Subject: ODBC driver and refcursors
> >> To: pgsql-odbc(at)postgresql(dot)org
> >> Date: Thursday, May 28, 2009, 10:25 AM
> >> Hi Everyone,
> >>
> >> I've been using 8.1 server and odbc driver with
> my
> >> application on windows and it has been working
> fine. I
> >> upgraded to 8.3.4 and started seeing issues with
> some of
> >> my
> >> queries.
> >>
> >> Here is the scenario:
> >>
> >> create table users (userid int, username
> varchar(10));
> >>
> >> insert into users values (1,'user1');
> >> insert into users values (2,'user2');
> >> insert into users values (3,'user3');
> >> insert into users values (4,'user4');
> >> insert into users values (5,'user5');
> >>
> >> -- And I have functions similar to this
> >>
> >> create or replace function test_cursor( refcursor,
> uid
> >> int)
> >> returns refcursor as
> >> $$
> >> BEGIN
> >>       open $1 for
> >>
> >> select userid, username
> >> from  users
> >> where userid >uid;
> >>
> >>       return $1;
> >> END;
> >> $$
> >> LANGUAGE 'plpgsql';
> >>
> >> -- My application sends this query
> >>
> >> select * from test_cursor('curs',3);
> >> fetch all in "curs";
>
> 8.2 or later drivers produces 2 result sets for the
> query.
>
> >> With 8.1 odbc driver, I get the below rows:
> >>
> >> userid  |  username
> >> --------------------
> >> 4    |  user4
> >> 5    |  user5
> >>
> >> And with 8.3 odbc driver, I get
> >>
> >> test_cursor
> >> ---------------
> >> curs
>
> Please call SQLMoreResults() or the command which
> corresponds
> to it before calling fetch operation.

Thanks for the reply Hiroshi!

I did some search on the net and wasn't able to find a sql command corresponding to SQLMoreReuslts(). I am using crystal reports so can't use SQLMoreResults() directly from there. Any more ideas?

Regards,
Farooq

>
> regards,
> Hiroshi Inoue
>
>
> --
> Sent via pgsql-odbc mailing list (pgsql-odbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-odbc
>

Browse pgsql-odbc by date

  From Date Subject
Next Message Craig Ringer 2009-06-02 15:13:07 Re: ODBC driver and refcursors
Previous Message Farooq 2009-06-02 10:15:06 Re: ODBC driver and refcursors