~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to docs/en_US/pg/sql-execute.html

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Enrici
  • Date: 2004-12-14 23:46:39 UTC
  • Revision ID: james.westby@ubuntu.com-20041214234639-tve0i5l49fq13jli
Tags: upstream-1.2.0
ImportĀ upstreamĀ versionĀ 1.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 
4
<title>EXECUTE</title>
 
5
<link rel="stylesheet" href="stylesheet.css" type="text/css">
 
6
<link rev="made" href="pgsql-docs@postgresql.org">
 
7
<meta name="generator" content="DocBook XSL Stylesheets V1.64.1">
 
8
<link rel="home" href="index.html" title="PostgreSQL 8.0.0beta5 Documentation">
 
9
<link rel="up" href="sql-commands.html" title="SQL Commands">
 
10
<link rel="previous" href="sql-end.html" title="END">
 
11
<link rel="next" href="sql-explain.html" title="EXPLAIN">
 
12
</head>
 
13
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
 
14
<a name="sql-execute"></a><div class="titlepage">
 
15
<div></div>
 
16
<div></div>
 
17
</div>
 
18
<div class="refnamediv">
 
19
<h2>Name</h2>
 
20
<p>EXECUTE &#8212; execute a prepared statement</p>
 
21
</div>
 
22
<a name="id2686609"></a><a name="id2686618"></a><div class="refsynopsisdiv">
 
23
<h2>Synopsis</h2>
 
24
<pre class="synopsis">EXECUTE <i class="replaceable"><tt>plan_name</tt></i> [ (<i class="replaceable"><tt>parameter</tt></i> [, ...] ) ]</pre>
 
25
</div>
 
26
<div class="refsect1" lang="en">
 
27
<a name="id2686647"></a><h2>Description</h2>
 
28
<p>   <tt class="command">EXECUTE</tt> is used to execute a previously prepared
 
29
   statement. Since prepared statements only exist for the duration of a
 
30
   session, the prepared statement must have been created by a
 
31
   <tt class="command">PREPARE</tt> statement executed earlier in the
 
32
   current session.
 
33
  </p>
 
34
<p>   If the <tt class="command">PREPARE</tt> statement that created the statement
 
35
   specified some parameters, a compatible set of parameters must be
 
36
   passed to the <tt class="command">EXECUTE</tt> statement, or else an
 
37
   error is raised. Note that (unlike functions) prepared statements are
 
38
   not overloaded based on the type or number of their parameters; the
 
39
   name of a prepared statement must be unique within a database session.
 
40
  </p>
 
41
<p>   For more information on the creation and usage of prepared statements,
 
42
   see <a href="sql-prepare.html">PREPARE</a>.
 
43
  </p>
 
44
</div>
 
45
<div class="refsect1" lang="en">
 
46
<a name="id2686702"></a><h2>Parameters</h2>
 
47
<div class="variablelist"><dl>
 
48
<dt><span class="term"><i class="replaceable"><tt>plan_name</tt></i></span></dt>
 
49
<dd><p>      The name of the prepared statement to execute.
 
50
     </p></dd>
 
51
<dt><span class="term"><i class="replaceable"><tt>parameter</tt></i></span></dt>
 
52
<dd><p>      The actual value of a parameter to the prepared statement.  This
 
53
      must be an expression yielding a value of a type compatible with
 
54
      the data type specified for this parameter position in the
 
55
      <tt class="command">PREPARE</tt> command that created the prepared
 
56
      statement.
 
57
     </p></dd>
 
58
</dl></div>
 
59
</div>
 
60
<div class="refsect1" lang="en">
 
61
<a name="id2686738"></a><h2>Outputs</h2>
 
62
<p>   The command tag returned by <tt class="command">EXECUTE</tt>
 
63
   is that of the prepared statement, and not <tt class="literal">EXECUTE</tt>.
 
64
  </p>
 
65
</div>
 
66
<div class="refsect1" lang="en">
 
67
<a name="id2686757"></a><h2>Examples</h2>
 
68
<p>    Examples are given in the <a href="sql-prepare.html#sql-prepare-examples">Examples</a> section of the <a href="sql-prepare.html">PREPARE</a> documentation.
 
69
   </p>
 
70
</div>
 
71
<div class="refsect1" lang="en">
 
72
<a name="id2686786"></a><h2>Compatibility</h2>
 
73
<p>   The SQL standard includes an <tt class="command">EXECUTE</tt> statement,
 
74
   but it is only for use in embedded SQL.  This version of the
 
75
   <tt class="command">EXECUTE</tt> statement also uses a somewhat different
 
76
   syntax.
 
77
  </p>
 
78
</div>
 
79
<div class="refsect1" lang="en">
 
80
<a name="id2686806"></a><h2>See Also</h2>
 
81
<span class="simplelist"><a href="sql-deallocate.html">DEALLOCATE</a>, <a href="sql-prepare.html">PREPARE</a></span>
 
82
</div>
 
83
</div></body>
 
84
</html>