agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: jonathansfl <jonathanbrinkman@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: postgres subfunction return error
Date: Fri, 27 Sep 2013 07:57:16 -0700 (PDT)
Message-ID: <1380293836468-5772613.post@n5.nabble.com> (raw)
In-Reply-To: <1380150677632-5772407.post@n5.nabble.com>
References: <1380150677632-5772407.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
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
<unnamed portal 32> (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
view thread (6+ messages) latest in thread
Message-ID: <1380293836468-5772613.post@n5.nabble.com>
Permalink: ../1380293836468-5772613.post@n5.nabble.com/
Also on: postgresql.org/message-id/1380293836468-5772613.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jonathanbrinkman@yahoo.com
Subject: Re: postgres subfunction return error
In-Reply-To: <1380293836468-5772613.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox