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

# db:prepare — Prepare query

DB:PREPARE prepares a database query. Arguments may be passed for identifier and literal substitution as parameters.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name |
| var_params | var |  | Variable name for associated parameter name and value pairs |

### Children
- db:query (occurrence: single) — Query

### Parents
- (not restricted in the reference)

### Result
- binding: var; type: n/a

### Examples

```xml
<output>
	<db:prepare>
		<param>ID</param>
		<param>contacts</param>
		<param>123</param>

		<db:query>
			<verbatim>SELECT $ FROM $ WHERE $0 = ?</verbatim>
		</db:query>
	</db:prepare>
</output>

<!-- SELECT "ID" FROM "contacts" WHERE "ID" = '123' -->
```
