# 3 - Binary Protocol (Prepared Statements)

- [COM\_STMT\_BULK\_EXECUTE](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_bulk_execute.md): This command executes a bulk insert for a previously prepared statement, using a compact binary format for efficiency.
- [COM\_STMT\_CLOSE](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/3-binary-protocol-prepared-statements-com_stmt_close.md): This command deallocates a prepared statement on the server, freeing up associated resources.
- [COM\_STMT\_EXECUTE](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_execute.md): This command executes a prepared statement using parameter values provided in the binary protocol format.
- [COM\_STMT\_FETCH](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_fetch.md): This command fetches rows from an existing result set of a prepared statement that was executed with a cursor.
- [COM\_STMT\_PREPARE](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_prepare.md): This command prepares an SQL statement on the server, returning a statement ID and metadata about parameters and columns.
- [COM\_STMT\_RESET](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_reset.md): This command resets the data of a prepared statement on the server, clearing any buffers or previous parameter values.
- [COM\_STMT\_SEND\_LONG\_DATA](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/com_stmt_send_long_data.md): This command sends long data, such as BLOB or TEXT values, in chunks for a specific parameter of a prepared statement.
- [Server Response Packets (Binary Protocol)](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/server-response-packets-binary-protocol.md): This section details the structure of response packets sent by the server when using the binary protocol, particularly for result sets.
- [PACKET\_BINDATA](https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements/server-response-packets-binary-protocol/packet_bindata.md): This packet type in the binary protocol transfers result set row data in a compact binary format, determined by the column types returned in metadata.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/clientserver-protocol/3-binary-protocol-prepared-statements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
