diff options
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/plpgsql.sgml | 12 |
1 files changed, 10 insertions, 2 deletions
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 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.127 2008/04/06 23:43:29 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.128 2008/05/03 00:11:36 tgl Exp $ --> <chapter id="plpgsql"> <title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title> @@ -1467,6 +1467,7 @@ RETURN <replaceable>expression</replaceable>; <synopsis> RETURN NEXT <replaceable>expression</replaceable>; RETURN QUERY <replaceable>query</replaceable>; +RETURN QUERY EXECUTE <replaceable class="command">command-string</replaceable> <optional> USING <replaceable>expression</replaceable> <optional>, ...</optional> </optional>; </synopsis> <para> @@ -1501,6 +1502,14 @@ RETURN QUERY <replaceable>query</replaceable>; </para> <para> + <command>RETURN QUERY</command> has a variant + <command>RETURN QUERY EXECUTE</command>, which specifies the + query to be executed dynamically. Parameter expressions can + be inserted into the computed query string via <literal>USING</>, + in just the same way as in the <command>EXECUTE</> command. + </para> + + <para> If you declared the function with output parameters, write just <command>RETURN NEXT</command> with no expression. On each execution, the current values of the output parameter @@ -1544,7 +1553,6 @@ SELECT * FROM getallfoo(); Note that functions using <command>RETURN NEXT</command> or <command>RETURN QUERY</command> must be called as a table source in a <literal>FROM</literal> clause. - </para> <note> |
