> ## 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 Read Only Statement

> Run a SQL query on a Databricks SQL warehouse and return the rows: a read-only statement (SELECT, WITH, SHOW, DESCRIBE or EXPLAIN) over Unity Catalog tables

Run a SQL query on a Databricks SQL warehouse and return the rows: a read-only statement (SELECT, WITH, SHOW, DESCRIBE or EXPLAIN) over Unity Catalog tables. Runs in a read-only session, so it can never change data; use databricks\_execute\_statement for INSERT, UPDATE, MERGE or DDL. The connection can only read tables its Databricks identity has SELECT on.

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

## 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).

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


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