# PROCEDURE

The `PROCEDURE` clause of [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select) passes the whole result set to a Procedure which will process it. These Procedures are not [Stored Procedures](https://mariadb.com/docs/server/server-usage/stored-routines/stored-procedures), and can only be written in the C language, so it is necessary to recompile the server.

Currently, the only available procedure is [ANALYSE](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/information-functions/procedure-analyse), which examines the resultset and suggests the optimal datatypes for each column. It is defined in the `sql/sql_analyse.cc` file, and can be used as an example to create more Procedures.

This clause cannot be used in a [view](https://mariadb.com/docs/server/server-usage/views) definition.

## See Also

* [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select)
* [Stored Procedures](https://mariadb.com/docs/server/server-usage/stored-routines/stored-procedures)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

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


---

# 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/sql-statements/data-manipulation/selecting-data/procedure.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.
