Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOyMo-0004Ux-En for pgsql-sql@arkaria.postgresql.org; Wed, 25 Sep 2013 23:19:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VOyMm-0005N1-Vd for pgsql-sql@arkaria.postgresql.org; Wed, 25 Sep 2013 23:19:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOyMl-0005Mq-WD for pgsql-sql@postgresql.org; Wed, 25 Sep 2013 23:19:32 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOyMi-00038Y-P2 for pgsql-sql@postgresql.org; Wed, 25 Sep 2013 23:19:31 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VOyMh-0006J9-JN for pgsql-sql@postgresql.org; Wed, 25 Sep 2013 16:19:27 -0700 Date: Wed, 25 Sep 2013 16:19:27 -0700 (PDT) From: David Johnston To: pgsql-sql@postgresql.org Message-ID: <1380151167590-5772408.post@n5.nabble.com> In-Reply-To: <1380150677632-5772407.post@n5.nabble.com> References: <1380150677632-5772407.post@n5.nabble.com> Subject: Re: postgres subfunction return error MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.8 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org jonathansfl wrote > greetings. I'm trying to write a function that acts like a switchboard, > calling other functions depending on incoming parameters. > I'm getting error: query has no destination for result data > > > SELECT * FROM dev.pr_test_subfunction(SWV_Action); In pl/pgsql if you do not use an "INTO" clause on a select statement you must replace the "SELECT" with "PERFORM". Failing to do so results in the error you are seeing. In this case your calls to the sub-function do not magically populate the parent function variables. You must manually map the output of the sub-function call query onto the parent variables. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/postgres-subfunction-return-error-tp5772407p5772408.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql