# 💡 Announcement: the "Update database table" action

**URL:** <https://community.easymorph.com/t/announcement-the-update-database-table-action/1964>\
**Category:** General Q&A\
**Created:** [July 6, 2020, 7:43am UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964 "2020-07-06T07:43:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [July 6, 2020, 7:43am UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964/1 "2020-07-06T07:43:53Z")

</div>

In v4.4 we've added the "Update database table" action that simplifies updating data in database tables with values from EasyMorph. Instead of 5 actions required previously, you can now update DB tables using just 1 action.

Here is an illustration how it works:

Data before:

 ![image](https://community.easymorph.com/uploads/default/original/2X/1/16cc1251aa61d4fef93d962d8db89061b42d216a.png)

The goal is to replace "M" with "Married" and "S" with "Single" in the [MaritalStatus] field. Here is an according "Update database table" action:

 ![image](https://community.easymorph.com/uploads/default/original/2X/9/9ec41117eff0dea60a0bae4aff480bbd42e7f0a1.png)

The result:

 ![image](https://community.easymorph.com/uploads/default/original/2X/3/3b50895cccf7062f2c59c68f01681edc759f6621.png)

Under the hood, the action generates an SQL UPDATE statement in the following format:

```auto
UPDATE db_table_name
SET db_field1 = easymorph_value1 , db_field2 = easymorph_value2 , ...
WHERE db_key_field1 = easymorph_key_value1 AND db_key_field2 = easymorph_key_value2 AND ...;

```

Note that each combination of values in matched key columns in EasyMorph must be unique, and correspond to only 1 row, in order to avoid ambiguity.

For instance, this is correct because every value in [Marital Status] (key field) corresponds to only one value in [NewMaritalStatus]:  
 ![image](https://community.easymorph.com/uploads/default/original/2X/7/7fdf4c4349723026f648098809c419f1b56dd476.png)

This is wrong and will make the action fail:  
 ![image](https://community.easymorph.com/uploads/default/original/2X/7/758a497a677bfb0a47ec21dd3223c9ac132ea7e0.png)

It's also possible to not specify matching key fields at all. In this case, the EasyMorph dataset must have only 1 row, and the underlying SQL UPDATE statement will look as follows:

```auto
UPDATE db_table_name
SET db_field1 = easymorph_value1 , db_field2 = easymorph_value2 , ...
;

```

If no matching fields are specified and the EasyMorph dataset has more than 1 row, the action will fail.

---

<div class="post-metadata">

**Author:** ![andrea\_campiello](https://community.easymorph.com/user_avatar/community.easymorph.com/andrea_campiello/32/2373_2.png) [@andrea\_campiello](https://community.easymorph.com/u/andrea_campiello)\
**Post date:** [December 21, 2020, 4:04pm UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964/2 "2020-12-21T16:04:59Z")

</div>

Dear all,

I tried the method but I receive an error: "update of row #0 failed with the following error: Overflow of an arithmetic operation.

What does it mean?

Regards

Andrea

---

<div class="post-metadata">

**Author:** ![andrew.rybka](https://community.easymorph.com/user_avatar/community.easymorph.com/andrew.rybka/32/13_2.png) [@andrew.rybka](https://community.easymorph.com/u/andrew.rybka)\
**Post date:** [December 22, 2020, 12:32pm UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964/3 "2020-12-22T12:32:36Z")

</div>

Hello Andrea and welcome to the Community!

Can you please answer the following questions:

- What database you are working with?
- What database connector you are using (native or ODBC?)
- If you are using an ODBC connector, what are the name and the version of the ODBC driver?
- What values does the first row of the input dataset has?
- What datatypes corresponding database columns have?

---

<div class="post-metadata">

**Author:** ![Hendrik\_Lombard](https://community.easymorph.com/user_avatar/community.easymorph.com/hendrik_lombard/32/1254_2.png) [@Hendrik\_Lombard](https://community.easymorph.com/u/Hendrik_Lombard)\
**Post date:** [April 9, 2025, 9:49pm UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964/4 "2025-04-09T21:49:46Z")

</div>

How can I update a database table WITHOUT using the "Update database table" action?  
i.e. the "instead of requiring 5 actions..."?

As I reported elsewhere "Update database action" is so slow in Snowflake that it is unusable.

---

<div class="post-metadata">

**Author:** ![andrew.rybka](https://community.easymorph.com/user_avatar/community.easymorph.com/andrew.rybka/32/13_2.png) [@andrew.rybka](https://community.easymorph.com/u/andrew.rybka)\
**Post date:** [April 10, 2025, 9:37am UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964/5 "2025-04-10T09:37:18Z")

</div>

You can create a temporary table, upload your data to that table, and then use the "Database command" action to run the `UPDATE ... FROM` query using the created temporary table.

---

<div class="post-metadata">

**Author:** ![Hendrik\_Lombard](https://community.easymorph.com/user_avatar/community.easymorph.com/hendrik_lombard/32/1254_2.png) [@Hendrik\_Lombard](https://community.easymorph.com/u/Hendrik_Lombard)\
**Post date:** [April 12, 2025, 2:23am UTC](https://community.easymorph.com/t/announcement-the-update-database-table-action/1964/6 "2025-04-12T02:23:28Z")

</div>

Ah. Thanks!
