> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mora.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL errors

> Send query errors to the AI for instant debugging help.

When a query fails in the SQL editor, Mora shows an error message in the results panel. You can send that error directly to the AI for help.

## Sending an error to the AI

1. Run a query that produces an error.
2. In the error message, click **Send to chat** (or the equivalent action).
3. The chat panel opens with the error pre-filled as a message.
4. The AI analyzes the error in context, it knows your query, datasource type, and schema.
5. It applies a fix to your draft, shown as a [diff](/ai/accepting-suggestions) you can review.

## What the AI considers

When debugging an error, the AI:

* Reads the full error message from your database.
* Examines your current SQL.
* Checks the database dialect (Postgres, Snowflake, etc.) to ensure the fix uses valid syntax.
* May search the catalog to verify table and column names.
* May run a corrected query to confirm it works before suggesting it.

## Common fixes

| Error type           | AI approach                                    |
| -------------------- | ---------------------------------------------- |
| Syntax errors        | Fix typos, missing commas, incorrect keywords. |
| Unknown column/table | Search the catalog and correct the name.       |
| Type mismatches      | Add casts or adjust the query logic.           |
| Ambiguous column     | Add table aliases to disambiguate.             |

## Related

* [Reviewing AI edits](/ai/accepting-suggestions), reviewing the AI's proposed fix.
* [SQL editor](/datasets/sql-editor)
* [AI overview](/ai/overview)
