diff --git a/doc/src/sgml/plsql.sgml b/doc/src/sgml/plsql.sgml index 12cd5de612023cf63b68dc5789dae4370228c04e..30097c81287f0d07b8c2fd7966d763a29dc4ed09 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: