Re: Getting the number or row returned by a select. Alway

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Getting the number or row returned by a select. Alway
Дата
Msg-id Pine.BSO.4.56.0504151459290.21687@leary.csoft.net
обсуждение исходный текст
Ответ на Getting the number or row returned by a select. Alway tought it was not possible until I say pgAdmin who gives it  (David Gagnon <dgagnon@siunik.com>)
Список pgsql-jdbc

On Fri, 15 Apr 2005, David Gagnon wrote:

> So did I miss something obvious.  Is it possible to get the total number
> of row returned from a query without doing another select.
>

Anytime you've got the results of a query you can loop over it to count
the number of elements.  In JDBC with a scrollable ResultSet you may issue
rs.last() and rs.getRow() to get the number of rows.  rs.beforeFirst()
will then reset the ResultSet back to its original state.

Kris Jurka

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

Предыдущее
От: David Gagnon
Дата:
Сообщение: Getting the number or row returned by a select. Alway tought it was not possible until I say pgAdmin who gives it
Следующее
От: "amp"
Дата:
Сообщение: Have Question