In a nutshell:
Is there a way of finding out how many rows (ROW_COUNT) are in a cursor
select? If one can, is there a way of returning a RECORD containing the
refcursor and the ROW_COUNT?
So far I've only been able to get a clue from:
1) Define function
create or replace function mycur(refcursor) returns refcursor AS '
BEGIN
open $1 for select * from abc;
RETURN $1;
END;
' LANGUAGE 'plpgsql';
2) Call function
temporary=> select mycur('cur');
mycur
-------
cur
(1 row)
3) Try to find end of cursor
temporary=> move 99 from cur;
MOVE 5
On 17/06/03, Joe Conway (mail@joeconway.com) wrote:
> Rory Campbell-Lange wrote:
> >Is this sensible, efficient, feasible? I have not used cursors before.
> >
> >Or should I simply do 2 separate functions, 1 for NUM_ROWS, the
> >other for the result set I want?
>
> It's hard to offer advice (at least for me) without more context. What
> are you trying to accomplish (in more detail), and in what type of
> application (web, fat client, etc)?
--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>