EXECUTE

|      EXECUTE       |                       |            |                  |                         |
|:------------------:|-----------------------|------------|------------------|-------------------------|
|[Prev](sql-end.html)|[Up](sql-commands.html)|SQL Commands|[Home](index.html)| [Next](sql-explain.html)|

---

[]()[]()

## EXECUTE

EXECUTE — execute a prepared statement

## Synopsis

```
EXECUTE name [ ( parameter [, ...] ) ]

```

## Description

`EXECUTE` 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 `PREPARE` statement executed earlier in the current session.

 If the `PREPARE` statement that created the statement specified some parameters, a compatible set of parameters must be passed to the `EXECUTE` 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.

 For more information on the creation and usage of prepared statements, see [PREPARE](sql-prepare.html).

## Parameters

*`name`*

 The name of the prepared statement to execute.

*`parameter`*

 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.

## Outputs

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

## Examples

 Examples are given in [Examples](sql-prepare.html#SQL-PREPARE-EXAMPLES) in the [PREPARE](sql-prepare.html) documentation.

## Compatibility

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

## See Also

[DEALLOCATE](sql-deallocate.html), [PREPARE](sql-prepare.html)

---

|[Prev](sql-end.html)|[Up](sql-commands.html)| [Next](sql-explain.html)|
|:-------------------|:---------------------:|------------------------:|
|        END         |  [Home](index.html)   |         EXPLAIN         |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>