Read up on refcursors - exactly what I wanted, thank you Adrian!
--
View this message in context:
http://postgresql.nabble.com/Dynamic-execution-returning-large-result-sets-tp5929177p5929211.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Sent via pgsql-general
On 11/06/2016 05:12 PM, Emrul wrote:
Hi,
I have a function that returns an SQL string as follows:
CREATE OR REPLACE FUNCTION t1() RETURNS text AS
$$
BEGIN
RETURN 'SELECT * FROM mytable';
END
$$ LANGUAGE plpgsql;
and I want to create a second function (t2) that will execute the string
returned b
Hi,
I have a function that returns an SQL string as follows:
CREATE OR REPLACE FUNCTION t1() RETURNS text AS
$$
BEGIN
RETURN 'SELECT * FROM mytable';
END
$$ LANGUAGE plpgsql;
and I want to create a second function (t2) that will execute the string
returned by t1() and return the results. I thoug