Re: execute block like Firebird does

Поиск
Список
Период
Сортировка
От PegoraroF10
Тема Re: execute block like Firebird does
Дата
Msg-id 1518357046559-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: execute block like Firebird does  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Ответы Re: execute block like Firebird does  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
but DO doesn´t return values, or it does ?

execute block returns(ID Integer, Name varchar(50), LastInvoice Date, ...)
as
begin
  for select ID, Name from Customers where ... into ID, Name do begin
    select bla, bla, bla from functionX(ID) into ...;
    if ... then
      bla = X
    else
      bla = Y;
    if bla = XXX then
      suspend; -- here we return a record and as we are inside a loop we
will return several records;
  end
end

As you can see, this entire block can be called from client dynamically,
their result fields are defined when it runs and we can return a set of
records. So, DO doen´t work this way, does it ?



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


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

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: execute block like Firebird does
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: execute block like Firebird does