Обсуждение: count record in plpgsql

Поиск
Список
Период
Сортировка

count record in plpgsql

От
"Nurdin"
Дата:
how can i know the count of record in plpgsql.example if i'm query with query komponent from delphi i will know the record count of record.but how with plpgsql.
 
any ideas?
 
thnx
best and regard
 
nurdin

Re: count record in plpgsql

От
Tomasz Myrta
Дата:
> how can i know the count of record in plpgsql.example if i'm query 
> with query komponent from delphi i will know the record count of 
> record.but how with plpgsql.
>  
> any ideas?

Is it what you need:

GET DIAGNOSTICS n = ROW_COUNT;

after executing query ?

Regards,
Tomasz Myrta


Re: count record in plpgsql

От
Richard Huxton
Дата:
Nurdin wrote:
> how can i know the count of record in plpgsql.example if i'm query
> with query komponent from delphi i will know the record count of
> record.but how with plpgsql.

GET DIAGNOSTICS integer_var = ROW_COUNT;

See the manual for details (plpgsql section, "Obtaining the result status").

HTH
--   Richard Huxton  Archonet Ltd