functions which return tuples

Поиск
Список
Период
Сортировка
От Igor Roboul
Тема functions which return tuples
Дата
Msg-id 20001027082342.A23496@linux.rainbow
обсуждение исходный текст
Ответы Re: functions which return tuples
Список pgsql-general
Hello,

Is it possible write stored procedure (sorry, function) which will
return tuples one by one. Like:
    select * from my_func(1,2,3);
    1 Ivan
    2 Petr
    3 Irzi
etc.
Like in, for example, Interbase (this is completely unnatural proc):
create procedure find_something_for(p integer, w integer)
returns (k integer, t varchar(30) )
as
begin

for select n,v from t001 into :k,:t do
begin
  if(n>10) then suspend;
end

end

'suspend' will return result to caller and then execution will continue
from saved position.

This is needed when computations is much harder than comparision n and 10

--
Igor Roboul, Unix System Administrator & Programmer @ sanatorium "Raduga",
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744

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