# Update

Updates one or more records in the specified Database Table.

Action available for the following operating systems:

![](/files/-MAlQBZuuTnc6hyzKSVQ)

### Parameters

* **Table** - Database Table to update the record(s).
* **Values** *\<string> or \<numeric> -* Value to assign to the specified *Column*. This expression will be evaluated accordingly with the *Type* column.
* **Ignore Database Masks** - If you've defined an *Output Mask* for the specified *Column* in the *Table* properties and:
  * This option is **checked** - You must specify the value in the Kalipso format.
  * This option is **unchecked** - You must specify the value in the *Mask* format.
* **Duplicate Quotes** - Check this option to automatically duplicate the *quote* (') character on the *Values* specified, to correctly insert the record in the database. For further information take a look at the examples below.
* **Where** *\<Kalipso Filter> or \<string> -* Condition to specify which records should be updated. Check Expressions chapter for more information about Kalipso Filter and String expressions. If this parameter is empty, an error may occur, if you have selected Prevent the execution of Update/Delete Statemens without Where clause in "Online" or "Offline", defined in the Project Properties. To bypass this safety feature without unchecking the options check Example 5.

### Usage

This function generates an Update operation that exists in every SQL database, and is used to update the database according to some condition.

Consider the following Database Table:

| **Products**                                      |                                                  |                                                    |
| ------------------------------------------------- | ------------------------------------------------ | -------------------------------------------------- |
| <p><strong>Code</strong> <em>Numeric</em><br></p> | <p><strong>Name</strong> <em>String</em><br></p> | <p><strong>Stock</strong> <em>Numeric</em><br></p> |
| 1                                                 | Coca Cola                                        | 100                                                |
| 2                                                 | Pepsi Cola                                       | 200                                                |
| 3                                                 | Pork Chops                                       | 300                                                |

#### Example 1

| **Table**            | Products               |                      |
| -------------------- | ---------------------- | -------------------- |
| **Columns**          | **Type**               | **Values**           |
| Code                 | Numeric                | 100                  |
| Name                 | String                 | "Coca Cola 'Updated" |
| Stock                | Numeric                | 400                  |
|                      |                        |                      |
| **Duplicate Quotes** | No                     |                      |
| **Where**            | FIELD(Products,Code)=1 |                      |

*Result:*

| **Products** |            |           |
| ------------ | ---------- | --------- |
| **Code**     | **Name**   | **Stock** |
| 1            | Coca Cola  | 100       |
| 2            | Pepsi Cola | 200       |
| 3            | Pork Chops | 300       |

{% hint style="warning" %}
It originates a syntax error because parameter **Duplicate Quotes** is unchecked.
{% endhint %}

#### Example 2

| **Table**            | Products               |                      |
| -------------------- | ---------------------- | -------------------- |
| **Colums**           | **Type**               | **Values**           |
| Code                 | Numeric                | 100                  |
| Name                 | String                 | "Coca Cola 'Updated" |
| Stock                | Numeric                | 400                  |
|                      |                        |                      |
| **Duplicate Quotes** | Yes                    |                      |
| **Where**            | FIELD(Products,Code)=1 |                      |

*Result:*

| **Products** |                    |           |
| ------------ | ------------------ | --------- |
| **Code**     | **Name**           | **Stock** |
| 100          | Coca Cola 'Updated | 400       |
| 2            | Pepsi Cola         | 200       |
| 3            | Pork Chops         | 300       |

#### Example 3

| **Table**            | Products                          |            |
| -------------------- | --------------------------------- | ---------- |
| **Columns**          | **Type**                          | **Values** |
| Code                 | Numeric                           |            |
| Name                 | String                            |            |
| Stock                | Numeric                           | 5000       |
|                      |                                   |            |
| **Duplicate Quotes** | No                                |            |
| **Where**            | FIELD(Products,Code) LIKE "%Cola" |            |

*Result:*

| **Products** |            |           |
| ------------ | ---------- | --------- |
| **Code**     | **Name**   | **Stock** |
| 1            | Coca Cola  | 5000      |
| 2            | Pepsi Cola | 5000      |
| 3            | Pork Chops | 3000      |

#### Example 4

| **Table**            | Products               |              |
| -------------------- | ---------------------- | ------------ |
| **Colums**           | **Type**               | **Values**   |
| Code                 | Numeric                | 003          |
| Name                 | String                 | "Pork Chops" |
| Stock                | Numeric                | 1000         |
|                      |                        |              |
| **Duplicate Quotes** | Yes                    |              |
| **Where**            | FIELD(Products,Code)=3 |              |

*Result:*

| **Products** |            |           |
| ------------ | ---------- | --------- |
| **Code**     | **Name**   | **Stock** |
| 1            | Coca Cola  | 100       |
| 2            | Pepsi Cola | 200       |
| 3            | Pork Chops | 1000      |

#### Example 5

| **Table**            | Products |            |
| -------------------- | -------- | ---------- |
| **Columns**          | **Type** | **Values** |
| Code                 | Numeric  |            |
| Name                 | String   |            |
| Stock                | Numeric  | 0          |
|                      |          |            |
| **Duplicate Quotes** | No       |            |
| **Where**            | 1=1      |            |

*Result:*

| **Products** |            |           |
| ------------ | ---------- | --------- |
| **Code**     | **Name**   | **Stock** |
| 1            | Coca Cola  | 0         |
| 2            | Pepsi Cola | 0         |
| 3            | Pork Chops | 0         |

{% hint style="info" %}
When you specify more than one condition in *Where* parameter, the operator used between the conditions is "**AND**" or "**OR**".
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://doc.sysdevmobile.com/kalipso5/developing/form/actions/actions-description/group-database/update.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
