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

# Execute Statement

> Execute any SQL statement on a Databricks SQL warehouse, including ones that change data: INSERT, UPDATE, DELETE, MERGE, CREATE, ALTER and DROP

Execute any SQL statement on a Databricks SQL warehouse, including ones that change data: INSERT, UPDATE, DELETE, MERGE, CREATE, ALTER and DROP. One statement per call; to only read data use databricks\_execute\_read\_only\_statement. The connection's Databricks identity needs write privileges (MODIFY on the table, CREATE TABLE on the schema), or Databricks refuses the change.

| | |
| - | - |
| **App** | Databricks |
| **Operation ID** | `databricks_execute_statement` |
| **Type** | Action |
| **Connection** | `databricks` (required) |
| **Credits per run** | 1 |
| **Agent / MCP tool** | Yes |
| **Requires approval** | Yes (write operation) |

## Inputs

| Field | Type | Required | Default | Description |
| - | - | - | - | - |
| `statement` | string | Yes | - | The SQL statement to run. One statement per call. |
| `warehouse_id` | string | No | - | SQL warehouse to run on (id from databricks\_list\_warehouses). Default: the first warehouse this connection can use, preferring one that is running. |
| `catalog_name` | string | No | - | Default catalog for unqualified names (Databricks `catalog`), like running USE CATALOG first. |
| `schema_name` | string | No | - | Default schema for unqualified names (Databricks `schema`), like running USE SCHEMA first. |
| `parameters` | array of StatementParameter | No | - | Values for named markers in the statement, Databricks' own `parameters` list of \{name, value, type}. Use them for any value that comes from a user or another step instead of writing it into the SQL. Example: statement "SELECT \* FROM sales WHERE country = :country AND day >= :since" with \[\{"name": "country", "value": "US"}, \{"name": "since", "value": "2026-01-01", "type": "DATE"}] |
| `row_limit` | integer | No | `1000` | Most rows to return (Databricks `row_limit`). Default 1000. When more rows match, metadata.truncated is true. Databricks aborts a statement whose result is larger than 25 MiB. |

### StatementParameter

| Field | Type | Required | Default | Description |
| - | - | - | - | - |
| `name` | string | Yes | - | Marker name, without the leading colon. |
| `value` | string or integer or number or boolean | No | - | The value; omit or null for SQL NULL. |
| `type` | string | No | - | Databricks SQL type such as INT, DECIMAL(10,2), DATE or TIMESTAMP. Default STRING, which Databricks casts to the column type. |

## Output

**Type**: `Dict`

Returns rows and metadata. rows: one object per row, keyed by column name, with numbers and booleans converted (integers and decimals too large for a JavaScript number stay text); dates, timestamps and complex types stay as Databricks returns them. metadata: statement\_id, warehouse\_id, total\_row\_count, truncated (true when row\_limit cut the result) and columns (name and type\_text). A statement that changes data returns one row with num\_affected\_rows and, for inserts, num\_inserted\_rows.

**Fields**: `rows`, `metadata`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.