Updating Multiple Datablaze Rows

Hi TB Community,

Is there a quick way to update/delete multiple rows at the same time within Datablaze?

For example - I will have multiple rows within one table that use the same address-- 4242 Mapledale Ave, Cleveland, OH 44109 (I'm tracking offers received on a property)

Is there a way to delete/update all of the rows that have that address at the same time?

Thank you

Hi @ajduna7 ,
You can only update one row at a time. To update multiple rows, use the repeat command.

{dbselect: SELECT rowid() as row FROM Table1 WHERE Name="John"; space=id; multiple=yes; menu=no}
{repeat: for item in row}{dbupdate: UPDATE Table1 SET Count=100 WHERE rowid() = @item;space=id} {endrepeat}

Hi Dan - I tried setting this up for my personal snippet without luck, and then set up the exact table and data used in your example- in my own Datablaze -- but when I used it - it gives me this error:

"Unknown field: item. The available fields are: name, count."

Do you happen to know the fix to this?

Thank you :slight_smile:

It seems your table contains different columns from the columns mentioned in your snippet.
Can you please recheck.

1 Like

Hi Vinod- I just double checked and here are my columns within the replica table:

image

Thank you

You're right. I was missing a @ to make it rowid() = @item. Fixed now.

1 Like

That worked perfectly - Thank you Dan!!

By the way, another way to write it is rowid() = {=item}

1 Like