]> begriffs open source - ai-pg/blob - full-docs/man7/EXECUTE.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / EXECUTE.7
1 '\" t
2 .\"     Title: EXECUTE
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "EXECUTE" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 EXECUTE \- execute a prepared statement
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 EXECUTE \fIname\fR [ ( \fIparameter\fR [, \&.\&.\&.] ) ]
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBEXECUTE\fR
40 is used to execute a previously prepared statement\&. Since prepared statements only exist for the duration of a session, the prepared statement must have been created by a
41 \fBPREPARE\fR
42 statement executed earlier in the current session\&.
43 .PP
44 If the
45 \fBPREPARE\fR
46 statement that created the statement specified some parameters, a compatible set of parameters must be passed to the
47 \fBEXECUTE\fR
48 statement, or else an error is raised\&. Note that (unlike functions) prepared statements are not overloaded based on the type or number of their parameters; the name of a prepared statement must be unique within a database session\&.
49 .PP
50 For more information on the creation and usage of prepared statements, see
51 \fBPREPARE\fR(7)\&.
52 .SH "PARAMETERS"
53 .PP
54 \fIname\fR
55 .RS 4
56 The name of the prepared statement to execute\&.
57 .RE
58 .PP
59 \fIparameter\fR
60 .RS 4
61 The actual value of a parameter to the prepared statement\&. This must be an expression yielding a value that is compatible with the data type of this parameter, as was determined when the prepared statement was created\&.
62 .RE
63 .SH "OUTPUTS"
64 .PP
65 The command tag returned by
66 \fBEXECUTE\fR
67 is that of the prepared statement, and not
68 EXECUTE\&.
69 .SH "EXAMPLES"
70 .PP
71 Examples are given in
72 Examples
73 in the
74 \fBPREPARE\fR(7)
75 documentation\&.
76 .SH "COMPATIBILITY"
77 .PP
78 The SQL standard includes an
79 \fBEXECUTE\fR
80 statement, but it is only for use in embedded SQL\&. This version of the
81 \fBEXECUTE\fR
82 statement also uses a somewhat different syntax\&.
83 .SH "SEE ALSO"
84 \fBDEALLOCATE\fR(7), \fBPREPARE\fR(7)