|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.12 2001/01/06 12:26:08 petere Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.13 2001/01/09 15:26:16 momjian Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <chapter id="plsql">
|
@@ -488,19 +488,29 @@ PERFORM <replaceable>query</replaceable>
|
488 | 488 | <listitem>
|
489 | 489 | <cmdsynopsis>
|
490 | 490 | <command>EXECUTE</command>
|
491 |
| - <arg choice="req"><replaceable class="command">query</replaceable></arg> |
| 491 | + <arg choice="req"><replaceable class="command">query-string</replaceable></arg> |
492 | 492 | </cmdsynopsis>
|
493 |
| - |
| 493 | + |
| 494 | + <para> |
| 495 | + where <replaceable>query-string</replaceable> is a string |
| 496 | + of type TEXT containing the <replaceable>query</replaceable> to be executed. |
| 497 | + </para> |
| 498 | + |
494 | 499 | <para>
|
495 | 500 | Unlike all other queries in PL/pgSQL, a
|
496 | 501 | <replaceable>query</replaceable> run by an EXECUTE statement
|
497 | 502 | is not prepared and saved just once during the life of the
|
498 | 503 | server. Instead, the <replaceable>query</replaceable> is
|
499 |
| - prepared each time the statement is run.This allows the |
500 |
| - <replaceable>query</replaceable>to be dynamically created |
| 504 | + prepared each time the statement is run.The |
| 505 | + <replaceable>query-string</replaceable>can be dynamically created |
501 | 506 | within the procedure to perform actions on variable tables and
|
502 | 507 | fields.
|
503 | 508 | </para>
|
| 509 | + |
| 510 | + <para> |
| 511 | +The results from SELECT queries are discarded by EXECUTE unless |
| 512 | +SELECT INTO is used to save the results into a table. |
| 513 | + </para> |
504 | 514 |
|
505 | 515 | <para>
|
506 | 516 | An example:
|
|