Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VPZTu-0000TF-IG for pgsql-sql@arkaria.postgresql.org; Fri, 27 Sep 2013 14:57:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VPZTt-0003TP-TY for pgsql-sql@arkaria.postgresql.org; Fri, 27 Sep 2013 14:57:21 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VPZTs-0003TI-KT for pgsql-sql@postgresql.org; Fri, 27 Sep 2013 14:57:20 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VPZTp-0000tT-Dl for pgsql-sql@postgresql.org; Fri, 27 Sep 2013 14:57:19 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VPZTo-0004ue-Gr for pgsql-sql@postgresql.org; Fri, 27 Sep 2013 07:57:16 -0700 Date: Fri, 27 Sep 2013 07:57:16 -0700 (PDT) From: jonathansfl To: pgsql-sql@postgresql.org Message-ID: <1380293836468-5772613.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: 4.5 (++++) 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 I'm trying to pass a REFCURSOR variable from a subfunction to its parent calling function, who will then pass it to the user (for parsing). thanks to David J I fixed it somewhat, but the user now receives the TEXT of (etc.) instead of the actual data in that REFCURSOR variable. I think the problem is with the "OPEN swv_refcur for SELECT v_outvar;" which is not returning the REFCURSOR's actual data. thank you for your help!! Jonathan NEW PARENT FUNCTION CODE: [CODE] CREATE OR REPLACE FUNCTION custom.pr_test_parentfunction ( v_action varchar, out swv_refcur refcursor, out swv_refcur2 refcursor, out swv_refcur3 refcursor ) RETURNS record AS $body$ DECLARE SWV_Action VARCHAR(50) DEFAULT Coalesce(v_Action,'1'); v_outvar1 REFCURSOR; v_outvar2 REFCURSOR; v_outvar3 REFCURSOR; BEGIN SELECT * INTO v_outvar1, v_outvar2, v_outvar3 FROM custom.pr_test_subfunction(SWV_Action); OPEN swv_refcur for SELECT v_outvar1; OPEN swv_refcur2 for SELECT v_outvar2; OPEN swv_refcur3 for SELECT v_outvar3; RETURN; END; $body$ LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER COST 100; [/CODE] -- View this message in context: http://postgresql.1045698.n5.nabble.com/postgres-subfunction-return-error-tp5772407p5772613.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