execute block like Firebird does - Mailing list pgsql-general

From PegoraroF10
Subject execute block like Firebird does
Date
Msg-id 1518328644815-0.post@n3.nabble.com
Whole thread Raw
Responses Re: execute block like Firebird does  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Re: execute block like Firebird does  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Re: execute block like Firebird does  (Edson Carlos Ericksson Richter <richter@simkorp.com.br>)
Re: execute block like Firebird does  (PegoraroF10 <marcos@f10.com.br>)
List pgsql-general
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 ?



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


pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: New Copy Formats - avro/orc/parquet
Next
From: Andreas Kretschmer
Date:
Subject: Re: execute block like Firebird does