> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/prepared-statements.md).

# Prepared Statements

{% columns %}
{% column %}
{% content-ref url="/pages/nRB9sYyuy8H5gOJB2NaH" %}
[DEALLOCATE / DROP PREPARE](/docs/server/reference/sql-statements/prepared-statements/deallocate-drop-prepare.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Release a prepared statement to free resources. This command removes the statement definition and its name from the current session.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/g57nd0BCQeKqBcC0OhKU" %}
[EXECUTE Statement](/docs/server/reference/sql-statements/prepared-statements/execute-statement.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Run a previously prepared statement. This command executes the statement using the specified name, optionally supplying input parameters.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/ZmXyCZ306FkXYXoUgTTl" %}
[EXECUTE IMMEDIATE](/docs/server/reference/sql-statements/prepared-statements/execute-immediate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Prepare and run a dynamic SQL statement in one step. This command simplifies the process by combining the PREPARE and EXECUTE operations.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/SpkNfR4PL4NvFs7Aot4G" %}
[PREPARE Statement](/docs/server/reference/sql-statements/prepared-statements/prepare-statement.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Parse and optimize a SQL statement for later use. This command assigns a name to the statement, enabling efficient execution with parameters.
{% endcolumn %}
{% endcolumns %}
