From: Bruce Momjian Date: Tue, 9 Jan 2001 15:26:16 +0000 (+0000) Subject: A patch for doc/src/sgml/plsql.sgml to add a little more info about PL/pgSQL X-Git-Tag: REL7_1~877 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d42c0f3acaaf6b21a64c0990c8f55c1c3e663f7;p=postgresql A patch for doc/src/sgml/plsql.sgml to add a little more info about PL/pgSQL EXECUTE. -- -------- Robert B. Easter --- diff --git a/doc/src/sgml/plsql.sgml b/doc/src/sgml/plsql.sgml index 12cd5de612..30097c8128 100644 --- a/doc/src/sgml/plsql.sgml +++ b/doc/src/sgml/plsql.sgml @@ -1,5 +1,5 @@ @@ -488,19 +488,29 @@ PERFORM query EXECUTE - query + query-string - + + + where query-string is a string + of type TEXT containing the query to be executed. + + Unlike all other queries in PL/pgSQL, a query run by an EXECUTE statement is not prepared and saved just once during the life of the server. Instead, the query is - prepared each time the statement is run. This allows the - query to be dynamically created + prepared each time the statement is run. The + query-string can be dynamically created within the procedure to perform actions on variable tables and fields. + + + The results from SELECT queries are discarded by EXECUTE unless + SELECT INTO is used to save the results into a table. + An example: