Re: [SQL] postgres subfunction return error

2013-09-27 Thread jonathansfl
Hurray, that works! Many thanks David 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_Act

Re: [SQL] postgres subfunction return error

2013-09-27 Thread David Johnston
jonathansfl wrote > 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; I've never used cursors in this

Re: [SQL] postgres subfunction return error

2013-09-27 Thread jonathansfl
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 proble

Re: [SQL] postgres subfunction return error

2013-09-25 Thread jonathansfl
Thank you! What kind of variable would I declare? Is this any form of right? No change to subfunction. In PARENT Function: DECLARE v_outvar1 REFCURSOR; v_outvar2 REFCURSOR; v_outvar3 REFCURSOR; ?And use: SELECT * INTO v_outvar1, v_outvar2, v_outvar3 FROM dev.pr_test_subfunction(SWV_Action);

Re: [SQL] postgres subfunction return error

2013-09-25 Thread David Johnston
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

[SQL] postgres subfunction return error

2013-09-25 Thread jonathansfl
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 Please advise what we're doing wrong. The subfunctions return a series of refcursors in a single table and si