Row count after SELECT INTO?

Поиск
Список
Период
Сортировка
От Alexander M. Pravking
Тема Row count after SELECT INTO?
Дата
Msg-id 20040407190426.GI41029@dyatel.antar.bryansk.ru
обсуждение исходный текст
Ответы Re: Row count after SELECT INTO?
Список pgsql-sql
Dear SQL and plPgSQL gurus, I seek for your wisdom.

I have a variable assignment via SELECT INTO in my function, and I want
to separate 3 cases:
1) no rows found;
2) one row found;
3) many rows found (ambiguous select).

The first case is simple, I use FOUND variable for it.
But how about the third? I tried to GET DIAGNOSTICS nrows = ROW_COUNT,
bit it seems to get only value of 0 or 1. Is this how it supposed to be
when SELECTing INTO a single variable?

The only way I see now is a FOR ... IN SELECT loop, and I woner if
there is a simpler solution. Could you please help me?


-- 
Fduch M. Pravking


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

Предыдущее
От: "Postgres User"
Дата:
Сообщение: varray? table of varchar?
Следующее
От: Martin Marques
Дата:
Сообщение: Re: SQL Standatd