Re: Info about number of tuples if not use FETCH ALL

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Info about number of tuples if not use FETCH ALL
Дата
Msg-id 20010813195826.B3475@svana.org
обсуждение исходный текст
Ответ на Info about number of tuples if not use FETCH ALL  ("Yusron Hilmy" <yusron@ebdesk.com>)
Список pgsql-general
On Mon, Aug 13, 2001 at 04:54:07PM +0700, Yusron Hilmy wrote:
> How to get number of tuples if after DECLARE CURSOR, I use FETCH NEXT (not
> FETCH ALL) ?
> PQntuples only work well if I use FETCH ALL.

You can't. The whole purpose of cursors is so that you don't have to wait
for the entire query to complete to get some results. Obviously, to get the
total number of tuples the whole query needs to be run, hence the FETCH ALL.

Do you really need to know the number of tuples beforehand, or is it ok to
wait till the end?

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Yusron Hilmy"
Дата:
Сообщение: Info about number of tuples if not use FETCH ALL
Следующее
От: Ivan Uemlianin
Дата:
Сообщение: Some questions on using arrays.