clac
August 24, 2021, 2:52pm
1
Hello,
I have a problem with the NocoDB node and especially with the update operation of the node. No matter what number I write in the “row_id” param, this node updates all my rows and not just the specific row I want.
Here are the params of my node :
So, I have tried to update my row with a simple HTTP request and it works perfectly.
Then, I suggest that there is a pb in the NocoDB node with the update row option. But I don’t know if I’m doing something wrong with this node or if there is actually a problem with the node.
Does anyone have the same issue with the NocoDB update row operation?
Hey @clac !
I tested the NocoDB node and it works for me as expected. It only updates the Row that I specify.
clac
August 25, 2021, 12:15pm
3
Thanks for your answer @harshil1712 !
So the pb should come from my setup. What are the params of the node you used please ?
Thanks !
My node looks similar to yours. Here’s the screenshot
1 Like
clac
August 25, 2021, 12:57pm
5
Okay, thank you very much ! I will dig deeper in my config to see where is the pb. Thanks
NocoDB update node uses bulk update API
Bulk update API is not generating WHERE clause in the SQL statement - this is a NocoDB bug (a pretty critical one if you ask me)
I’ve just created a bug report
opened 03:29AM - 08 Mar 22 UTC
Type: Enhancement
This is a **critical** bug because, even if the query succeeds, it'll update row… s you don't want to update (all of them)
NocoDB used as docker : true
NocoDB version : 0.84.14
Database used in NC_DB URL : sqlite3
Project was created by clicking : New Project by connecting to external database
Database on which spreadsheet is created : pg
OS on which NocoDB is running : Linux
Node.js version if running as node : N/A
Database version :
**Steps To Reproduce**
Do REST API request to bulk update, e.g.
```json
[
{
"id": 2,
"email": "[email protected] "
},
{
"id": 3,
"email": "[email protected] "
}
]
```
(please note I haven't literally tested the example above, I found this bug within n8n's NocoDB integration)
**Expected behavior**
Bulk update succeeds
**What happens**
```
error: update "mytable" set "id" = $1, "email" = $2 - duplicate key value violates unique constraint "mytable_pkey"
```
**It's missing the WHERE clause for UPDATE** - all rows would be updated if the query succeeds
Until this bug is fixed, you should not use this n8n node (at least on PostgreSQL - the setup I’ve verified this bug)