08.12.2021 12:37, Tony Whyman wrote:

It would also be very useful to get rowcount returned for unidirectional cursors if that was readily possible. At present, it is only possible to get an accurate count of the number of rows in a cursor after you have fetched all of them.

It cannot be calculated without fetching all rows, even inside the engine. For scrollable cursors, rows are prefetched and cached by the engine and thus the count can be easily returned. It has its cost, but generally it's unavoidable anyway for scrollable cursors. However, prefetching uni-directional cursors in advance would be a huge overkill which nobody usually needs. So "row count" is likely to return zero or error for uni-directional cursors. However, if you desperately needs "row count" and ready to pay the price, then just open the cursor as scrollable and fetch only forward. The "row count" will be available automagically.


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to