HubDb API - How to implement where clause and how to update two cells of a table together

hubdb

#1

I want to perform the below mysql query using HubDb API. . . Please help...

"UPDATE Customers SET ContactName = 'Alfred Schmidt', City= 'Frankfurt' WHERE CustomerID = 1;"


#2

Hi @kalpana790,

To update a table row, you need the internal row ID. You might consider pulling the row you're looking for using the 'Get table rows' endpoint (filtering by CustomerID) and then updating that row once you have the row ID.


#3

I just want to update two cells of a row (row has 5 cells) where customerId = 1

I applied for loop to do this but i want another way to do this.


#4

Hi @kalpana790,

You can get the row with customerId=1 using the 'Get table rows' endpoint & the EQUALS filter. Then, you can use the rowId to update both cells at once by using the 'Update a row' endpoint. HubDB isn't a fully fledged relational database, so it's not possible to make the query you specified above.