> For the complete documentation index, see [llms.txt](https://easycatalog.nousmedis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easycatalog.nousmedis.com/setting-up-your-data/2.-importing-your-data/data-from-an-odbc-compliant-database/updating-the-database.md).

# Updating the database

Each field has an associated SQL statement which is used to update new content to the database. This functionality is optional, and is configured using EasyCatalog’s field Options dialog.

## Field options dialog

SQL statements must be configured for each field that will be updated on the database. Keywords can be included in the statement which are replaced with field content, key field value, etc.

Only fields with the `Update Using statement` check-box set will be updated to the database, regardless of whether the update statement has been entered.

<figure><img src="/files/iXrufRLxiZplv2OjgpzK" alt=""><figcaption><p>Database update Field Options</p></figcaption></figure>

## Update using statement

The ODBC Data Provider substitutes keywords contained in the statement immediately prior to execution to construct an SQL statement. These keywords are:

<table><thead><tr><th width="183">Keyword</th><th>Value</th></tr></thead><tbody><tr><td><code>{{VALUE}}</code></td><td>Replaced with the current value of the field</td></tr><tr><td><code>{{KEY}}</code></td><td>Replaced with the unique key for the record</td></tr><tr><td><code>{{FIELDNAME}}</code></td><td>The content of other fields for this record can be referenced by including the field name in <strong>upper case</strong>. e.g. <code>{{PART_NO}}</code></td></tr></tbody></table>

### The Use of Quotes within the statement

When building your ‘update’ statements, it is important to ensure that quotes are used to enclose alphanumeric data.

Typically, around table and column names double quotes (") should be used. Field content should be enclosed in single quotes ('):

```sql
update "Stock" set "myfield" = '{{VALUE}}' where "key" = '{{KEY}}'
```

In the above SQL statement, `Stock`, `myfield` and `key` are table and column names; `VALUE` and `KEY` are field content. The usage shown here is typical, and depends on the type of database being connected to.

## Updating the database

The database will be updated with the contents of the panel, so first use the `Update panel` menu option to update the panel with the latest information from the document.

To update the database with the latest data, use the `Update Data Source...` menu option from the EasyCatalog data panel.

Only data that has changed in the panel will be updated to the database. A blue dotted outline shows the data that needs updating to the database.

<figure><img src="/files/VX5VG0Hz2REQVYBWUxPI" alt="Field content updated"><figcaption><p>A blue dotted outline shows the data that needs updating to the database.</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://easycatalog.nousmedis.com/setting-up-your-data/2.-importing-your-data/data-from-an-odbc-compliant-database/updating-the-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
