Question: For single record update, I have tried the following code and it's working.

```
uid=1

info = Info.query.filter_by(id=uid).first()
info.sold_status ='1'
db.session.add(info)
db.session.commit()

```

Now I want to update one column for multiple rows.
I have tried:

```
for row in db.session.query(Uninstall.status).all():
     print row.status

abc=row.status
abc=uid

db.session.add(row.status)
db.session.commit()

```

but it's not working.

Thanks in advance :)

Answer: 
The suggested is not optimized. You can use the options to update:
1. 

```
for row in Uninstall.query:  # all() is extra
    row.status = new_status
Session.commit()

```

If there are lots of rows, it can be faster, but it will invoke `UPDATE` for every row. Not good, is it? 

2.

```
Uninstall.query.update({Uninstall.status: new_status}) 
Session.commit()

```

Invokes only one `UPDATE` query for all rows.
query the table to get the rows and you can update the columns while iterating over them and commit once its done.

```
for row in Uninstall.query.all():
    row.status = <new status>
db.session.commit()

```