Re: execute block like Firebird does

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: execute block like Firebird does
Дата
Msg-id ecd15713-94c2-7532-b5cf-b448cd9bb652@a-kretschmer.de
обсуждение исходный текст
Ответ на execute block like Firebird does  (PegoraroF10 <marcos@f10.com.br>)
Ответы Re: execute block like Firebird does  (Fabrízio de Royes Mello <fabrizio@timbira.com.br>)
Re: execute block like Firebird does  (PegoraroF10 <marcos@f10.com.br>)
Список pgsql-general

Am 11.02.2018 um 06:57 schrieb PegoraroF10:
> We are migrating our databases from Firebird to PostGres. A useful feature
> Firebird has is Execute Block.
> What it does is just return a record set from that dynamic SQL, just like a
> PostGres function, but without creating it.
> It sound like ...
> execute block returns(ID Integer, Name varchar(50), LastInvoice Date, ...)
> as
> begin
>    select bla, bla, bla into ...;
>    select bla, bla into ...;
>    suspend;
> end
> I know we could create a function but we have several hundred of these
> blocks running, so ... it would be a huge work to do.
> So, there is a way to run a dynamic sql which returns a set of records ?

you can use a DO - block:


https://www.postgresql.org/docs/current/static/sql-do.html


Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com



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

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