> 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/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_send_long_data.md).

# mysql\_stmt\_send\_long\_data

## Syntax

```c
my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt,
                                  unsigned int,
                                  const char * data,
                                  unsigned long);
```

## Parameter

* `stmt` - a statement handle, which was previously allocated by [mysql\_stmt\_init()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_init.md).
* `param_no` - indicates which parameter to associate the data with. Parameters are numbered beginning with 0.
* `data` - a buffer containing the data to send.
* `long` - size of the data buffer.

## Description

Allows sending parameter data to the server in pieces (or chunks), e.g. if the size of a blob exceeds the size of [max\_allowed\_packet](/docs/server/server-management/variables-and-modes/server-system-variables.md#max_allowed_packet). This function can be called multiple times to send the parts of a character or binary data value for a column, which must be one of the [TEXT](/docs/server/reference/data-types/string-data-types/text.md) or [BLOB](/docs/server/reference/data-types/string-data-types/blob.md) datatypes.

## Return Value

Returns zero on success, nonzero if an error occurred.

{% hint style="info" %}

* `mysql_stmt_send_long_data()` must be called before [mysql\_stmt\_execute()](https://github.com/mariadb-corporation/mariadb-connector-c/wiki/mysql_stmt_execute).
* bound variables for this column will be ignored when calling [mysql\_stmt\_execute()](https://github.com/mariadb-corporation/mariadb-connector-c/wiki/mysql_stmt_execute).
  {% endhint %}

## See Also

* [mysql\_stmt\_execute()](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_execute.md)

{% @marketo/form formId="4316" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_send_long_data.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.
