Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eks1s-0003w9-Nb for pgsql-general@arkaria.postgresql.org; Sun, 11 Feb 2018 13:50:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eks1r-0006Yf-Gz for pgsql-general@arkaria.postgresql.org; Sun, 11 Feb 2018 13:50:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eks1r-0006YV-5S for pgsql-general@lists.postgresql.org; Sun, 11 Feb 2018 13:50:51 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eks1o-0000vK-6n for pgsql-general@postgresql.org; Sun, 11 Feb 2018 13:50:49 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 898A7B18B873 for ; Sun, 11 Feb 2018 06:50:46 -0700 (MST) Date: Sun, 11 Feb 2018 06:50:46 -0700 (MST) From: PegoraroF10 To: pgsql-general@postgresql.org Message-ID: <1518357046559-0.post@n3.nabble.com> In-Reply-To: References: <1518328644815-0.post@n3.nabble.com> Subject: Re: execute block like Firebird does MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk but DO doesn=C2=B4t return values, or it does ? execute block returns(ID Integer, Name varchar(50), LastInvoice Date, ...)= =20 as=20 begin=20 for select ID, Name from Customers where ... into ID, Name do begin select bla, bla, bla from functionX(ID) into ...;=20 if ... then bla =3D X else=20 bla =3D Y; if bla =3D 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=C2=B4t work this way, does it ? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.ht= ml