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 1ektwf-0001hw-H6 for pgsql-general@arkaria.postgresql.org; Sun, 11 Feb 2018 15:53:37 +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 1ektwc-0003EW-Rk for pgsql-general@arkaria.postgresql.org; Sun, 11 Feb 2018 15:53:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ektwc-0003EM-KQ for pgsql-general@lists.postgresql.org; Sun, 11 Feb 2018 15:53:34 +0000 Received: from 23-25-19-49-static.hfc.comcastbusiness.net ([23.25.19.49] helo=jeeves.wrkhors.com) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ektwZ-0004kT-3z for pgsql-general@lists.postgresql.org; Sun, 11 Feb 2018 15:53:33 +0000 Received: from wrkhors.com (localhost [127.0.0.1]) by jeeves.wrkhors.com (Postfix) with ESMTP id 3C3A010EE01; Sun, 11 Feb 2018 09:56:25 -0600 (CST) Date: Sun, 11 Feb 2018 09:52:41 -0600 From: Steven Lembark To: pgsql-general@lists.postgresql.org Cc: lembark@wrkhors.com Subject: Re: execute block like Firebird does Message-ID: <20180211095241.494f60ac@wrkhors.com> In-Reply-To: References: <1518328644815-0.post@n3.nabble.com> Organization: Workhorse Computing MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > > you can use a DO - block: > > > > > > https://www.postgresql.org/docs/current/static/sql-do.html > > > > But DO blocks returns "void", I mean you can't return values/records > from this statement. Insert the necessary records into a temporary table, process them, post-process them into variables or destination table? -- Steven Lembark 1505 National Ave Workhorse Computing Rockford, IL 61103 lembark@wrkhors.com +1 888 359 3508