~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/execute.sgml

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
$PostgreSQL: pgsql/doc/src/sgml/ref/execute.sgml,v 1.12 2004-09-30 04:23:27 neilc Exp $
 
3
PostgreSQL documentation
 
4
-->
 
5
 
 
6
<refentry id="SQL-EXECUTE">
 
7
 <refmeta>
 
8
  <refentrytitle id="sql-execute-title">EXECUTE</refentrytitle>
 
9
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 
10
 </refmeta>
 
11
 
 
12
 <refnamediv>
 
13
  <refname>EXECUTE</refname>
 
14
  <refpurpose>execute a prepared statement</refpurpose>
 
15
 </refnamediv>
 
16
 
 
17
 <indexterm zone="sql-execute">
 
18
  <primary>EXECUTE</primary>
 
19
 </indexterm>
 
20
 
 
21
 <indexterm zone="sql-execute">
 
22
  <primary>prepared statements</primary>
 
23
  <secondary>executing</secondary>
 
24
 </indexterm>
 
25
 
 
26
 <refsynopsisdiv>
 
27
<synopsis>
 
28
EXECUTE <replaceable class="PARAMETER">plan_name</replaceable> [ (<replaceable class="PARAMETER">parameter</replaceable> [, ...] ) ]
 
29
</synopsis>
 
30
 </refsynopsisdiv>
 
31
 
 
32
 <refsect1>
 
33
  <title>Description</title>
 
34
 
 
35
  <para>
 
36
   <command>EXECUTE</command> is used to execute a previously prepared
 
37
   statement. Since prepared statements only exist for the duration of a
 
38
   session, the prepared statement must have been created by a
 
39
   <command>PREPARE</command> statement executed earlier in the
 
40
   current session.
 
41
  </para>
 
42
 
 
43
  <para>
 
44
   If the <command>PREPARE</command> statement that created the statement
 
45
   specified some parameters, a compatible set of parameters must be
 
46
   passed to the <command>EXECUTE</command> statement, or else an
 
47
   error is raised. Note that (unlike functions) prepared statements are
 
48
   not overloaded based on the type or number of their parameters; the
 
49
   name of a prepared statement must be unique within a database session.
 
50
  </para>
 
51
 
 
52
  <para>
 
53
   For more information on the creation and usage of prepared statements,
 
54
   see <xref linkend="sql-prepare" endterm="sql-prepare-title">.
 
55
  </para>
 
56
 </refsect1>
 
57
 
 
58
 <refsect1>
 
59
  <title>Parameters</title>
 
60
 
 
61
  <variablelist>
 
62
   <varlistentry>
 
63
    <term><replaceable class="PARAMETER">plan_name</replaceable></term>
 
64
    <listitem>
 
65
     <para>
 
66
      The name of the prepared statement to execute.
 
67
     </para>
 
68
    </listitem>
 
69
   </varlistentry>
 
70
 
 
71
   <varlistentry>
 
72
    <term><replaceable class="PARAMETER">parameter</replaceable></term>
 
73
    <listitem>
 
74
     <para>
 
75
      The actual value of a parameter to the prepared statement.  This
 
76
      must be an expression yielding a value of a type compatible with
 
77
      the data type specified for this parameter position in the
 
78
      <command>PREPARE</command> command that created the prepared
 
79
      statement.
 
80
     </para>
 
81
    </listitem>
 
82
   </varlistentry>
 
83
  </variablelist>
 
84
 </refsect1>
 
85
 
 
86
 <refsect1>
 
87
  <title>Outputs</title>
 
88
   <para>
 
89
   The command tag returned by <command>EXECUTE</command>
 
90
   is that of the prepared statement, and not <literal>EXECUTE</>.
 
91
  </para>
 
92
 </refsect1>
 
93
 
 
94
 <refsect1>
 
95
  <title>Examples</>
 
96
  <para>
 
97
    Examples are given in the <xref linkend="sql-prepare-examples"
 
98
    endterm="sql-prepare-examples-title"> section of the <xref
 
99
    linkend="sql-prepare" endterm="sql-prepare-title"> documentation.
 
100
   </para>
 
101
 </refsect1>
 
102
 
 
103
 <refsect1>
 
104
  <title>Compatibility</title>
 
105
 
 
106
  <para>
 
107
   The SQL standard includes an <command>EXECUTE</command> statement,
 
108
   but it is only for use in embedded SQL.  This version of the
 
109
   <command>EXECUTE</command> statement also uses a somewhat different
 
110
   syntax.
 
111
  </para>
 
112
 </refsect1>
 
113
 
 
114
 <refsect1>
 
115
  <title>See Also</title>
 
116
 
 
117
  <simplelist type="inline">
 
118
   <member><xref linkend="sql-deallocate" endterm="sql-deallocate-title"></member>
 
119
   <member><xref linkend="sql-prepare" endterm="sql-prepare-title"></member>
 
120
  </simplelist>
 
121
 </refsect1>
 
122
</refentry>
 
123
 
 
124
<!-- Keep this comment at the end of the file
 
125
Local variables:
 
126
mode: sgml
 
127
sgml-omittag:nil
 
128
sgml-shorttag:t
 
129
sgml-minimize-attributes:nil
 
130
sgml-always-quote-attributes:t
 
131
sgml-indent-step:1
 
132
sgml-indent-data:t
 
133
sgml-parent-document:nil
 
134
sgml-default-dtd-file:"../reference.ced"
 
135
sgml-exposed-tags:nil
 
136
sgml-local-catalogs:"/usr/lib/sgml/catalog"
 
137
sgml-local-ecat-files:nil
 
138
End:
 
139
-->