> 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/programmatic-compound-statements/programmatic-compound-statements-diagnostics.md).

# Diagnostics

{% columns %}
{% column %}
{% content-ref url="/pages/6nnBwqy8qUmGU1hIA31S" %}
[Diagnostics Area](/docs/server/reference/sql-statements/programmatic-compound-statements/programmatic-compound-statements-diagnostics/diagnostics-area.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Describes the diagnostics area that holds statement and condition information about errors, warnings, and notes produced by an SQL statement, including its properties and how it is populated and cleared.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/HPF7NvdFQa0Dgj1T3B96" %}
[GET DIAGNOSTICS](/docs/server/reference/sql-statements/programmatic-compound-statements/programmatic-compound-statements-diagnostics/get-diagnostics.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
GET DIAGNOSTICS copies statement and condition information from the diagnostics area into user or local variables, reading properties such as NUMBER, RETURNED\_SQLSTATE, MYSQL\_ERRNO, and MESSAGE\_TEXT.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/6RVJUAIQSeyfh1DJLAnG" %}
[SQLSTATE](/docs/server/reference/sql-statements/programmatic-compound-statements/programmatic-compound-statements-diagnostics/sqlstate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Explains SQLSTATE, the five-character code identifying SQL error conditions by class and subclass, including the standard success, warning, and not-found classes and how they map to handler keywords.
{% endcolumn %}
{% endcolumns %}
