---
title: "db:run — Run query"
description: "iXML command db:run: Run query."
canonical_url: "https://www.zeyos.com/ixml/ref/db-run"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/db-run.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# db:run — Run query

DB:RUN executes an arbitrary SQL statement and retrieves the accordant result set from the database.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name for retrieved result set |
| type | type | num | Result set type |

#### Possible values
Possible values for `type`:
- num — Multidimensional array with consecutive numeric keys
- assoc — Multidimensional array with field names as keys
- list — Unidimensional list
- av — Unidimensional array with associated attribute and value pairs
- single — Single array item with consecutive numeric keys
- self — Single array item with field names as keys
- value — Single value


### Children
- (none)

### Parents
- db:connection

### Result
- binding: var; type: array; predicate: no-result-propagation

### Examples

```xml
<db:run var="data" type="assoc">
	SELECT * FROM "contacts"
</db:run>
```
