Re: Get the number of records of a result set

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема Re: Get the number of records of a result set
Дата
Msg-id 1201682117.12583.1.camel@neuromancer.home.net
обсуждение исходный текст
Ответ на Get the number of records of a result set  (Eugenio Tacchini <eugenio.tacchini@elfo.net>)
Ответы Re: Get the number of records of a result set  (Eugenio Tacchini <eugenio.tacchini@elfo.net>)
Список pgsql-general
On Wed, 2008-01-30 at 09:14 +0100, Eugenio Tacchini wrote:
> Hello,
> I'm writing a function in PL/pgSQL and I would like to know if there
> is a method to get the number of records in a result set, after a
> select query, without executing the same query using COUNT(*).


not sure what exactly you mean, but perhaps this could help?

    del_stime := timeofday();
    execute del_qry;
    del_etime := timeofday();

    GET DIAGNOSTICS del_rows = ROW_COUNT;

This would get you the # of rows inserted into the destination table
etc.


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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Get the number of records of a result set
Следующее
От: Håkan Jacobsson
Дата:
Сообщение: Re: Getting the count(*) from two tables and two date ranges in same query