> 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/clientserver-protocol/3-binary-protocol-prepared-statements.md).

# 3 - Binary Protocol (Prepared Statements)

{% columns %}
{% column %}
{% content-ref url="/pages/UEAPObIBHTTq0qqiBFyY" %}
[COM\_STMT\_BULK\_EXECUTE](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_bulk_execute.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command executes a bulk insert for a previously prepared statement, using a compact binary format for efficiency.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/gymBBmh6qGlpsVQTW9LG" %}
[COM\_STMT\_CLOSE](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/3-binary-protocol-prepared-statements-com_stmt_close.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command deallocates a prepared statement on the server, freeing up associated resources.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/dIsDGyuz9uXxFsZdpRl4" %}
[COM\_STMT\_EXECUTE](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_execute.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command executes a prepared statement using parameter values provided in the binary protocol format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/V9OOjAyZ8W0lNOIdeRDx" %}
[COM\_STMT\_FETCH](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_fetch.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command fetches rows from an existing result set of a prepared statement that was executed with a cursor.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/5SzQXhwDg6ep3krixzUF" %}
[COM\_STMT\_PREPARE](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_prepare.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command prepares an SQL statement on the server, returning a statement ID and metadata about parameters and columns.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/70vPzWAqQoJkj9fhbtkk" %}
[COM\_STMT\_RESET](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_reset.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command resets the data of a prepared statement on the server, clearing any buffers or previous parameter values.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/mmm2EvJvwxJa0ePzTRXU" %}
[COM\_STMT\_SEND\_LONG\_DATA](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_send_long_data.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This command sends long data, such as BLOB or TEXT values, in chunks for a specific parameter of a prepared statement.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/EASjI8paNaQLwHOrgAZh" %}
[Server Response Packets (Binary Protocol)](/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/server-response-packets-binary-protocol.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
This section details the structure of response packets sent by the server when using the binary protocol, particularly for result sets.
{% endcolumn %}
{% endcolumns %}
