From 47391591ba6aa1c7153372f09d1f88c98a0165d4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 3 May 2008 00:11:36 +0000 Subject: Support RETURN QUERY EXECUTE in plpgsql. Pavel Stehule --- doc/src/sgml/plpgsql.sgml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 8eac671fabf..1065eddc74e 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -1,4 +1,4 @@ - + <application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language @@ -1467,6 +1467,7 @@ RETURN expression; RETURN NEXT expression; RETURN QUERY query; +RETURN QUERY EXECUTE command-string USING expression , ... ; @@ -1500,6 +1501,14 @@ RETURN QUERY query; let control reach the end of the function). + + RETURN QUERY has a variant + RETURN QUERY EXECUTE, which specifies the + query to be executed dynamically. Parameter expressions can + be inserted into the computed query string via USING, + in just the same way as in the EXECUTE command. + + If you declared the function with output parameters, write just RETURN NEXT with no expression. On each @@ -1544,7 +1553,6 @@ SELECT * FROM getallfoo(); Note that functions using RETURN NEXT or RETURN QUERY must be called as a table source in a FROM clause. - -- cgit v1.2.3