executeQuery
executeQueryExecute read-only SQL queries (SELECT, WITH, EXPLAIN) on PostgreSQL, Oracle, or SQL Server to fetch actual result rows. Supports positional or named parameters, with optional row limits and timeouts.
Instructions
Run a read-only SQL SELECT / WITH / EXPLAIN when actual result rows are needed. Use timedQuery for one timed execution or benchmarkQuery for repeated latency measurements. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name. Sets 'truncated' when the row cap is hit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No | Row limit (default JDBC_MAX_ROWS). | |
| params | No | Values for '?' placeholders, in order. | |
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. | |
| namedParams | No | Values for ':name' placeholders, keyed by name. | |
| timeoutSeconds | No | Timeout in seconds (default JDBC_QUERY_TIMEOUT_SECONDS). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Rows. | |
| columns | No | Columns. | |
| rowCount | Yes | Row Count. | |
| truncated | Yes | Truncated. | |
| columnTypes | No | Column Types. |