1EXECUTE()                        SQL Commands                        EXECUTE()
2
3
4

NAME

6       EXECUTE - execute a prepared statement
7
8

SYNOPSIS

10       EXECUTE name [ (parameter [, ...] ) ]
11
12

DESCRIPTION

14       EXECUTE  is used to execute a previously prepared statement. Since pre‐
15       pared statements only exist for the duration of a session, the prepared
16       statement  must  have been created by a PREPARE statement executed ear‐
17       lier in the current session.
18
19       If the PREPARE statement that  created  the  statement  specified  some
20       parameters,  a  compatible set of parameters must be passed to the EXE‐
21       CUTE statement, or else an error is raised.  Note  that  (unlike  func‐
22       tions) prepared statements are not overloaded based on the type or num‐
23       ber of their parameters; the name  of  a  prepared  statement  must  be
24       unique within a database session.
25
26       For  more information on the creation and usage of prepared statements,
27       see PREPARE [prepare(7)].
28

PARAMETERS

30       name   The name of the prepared statement to execute.
31
32       parameter
33              The actual value of a parameter to the prepared statement.  This
34              must  be  an expression yielding a value that is compatible with
35              the data type of this parameter, as was determined when the pre‐
36              pared statement was created.
37

OUTPUTS

39       The  command tag returned by EXECUTE is that of the prepared statement,
40       and not EXECUTE.
41

EXAMPLES

43       Examples are given in the Examples [prepare(7)] section of the  PREPARE
44       [prepare(l)] documentation.
45

COMPATIBILITY

47       The  SQL standard includes an EXECUTE statement, but it is only for use
48       in embedded SQL. This version of the  EXECUTE  statement  also  uses  a
49       somewhat different syntax.
50

SEE ALSO

52       DEALLOCATE [deallocate(7)], PREPARE [prepare(l)]
53
54
55
56SQL - Language Statements         2008-06-08                         EXECUTE()
Impressum