best way to update SQL Tab Data

NoName

Member
Licensed User
Longtime User
Hi,

I fill a scroll view with panels/labels etc. (similar to the "CustomScrollView" Example) with a tab of a SQLite DB. Name/Street/Zip etc. Works very fine!

The Fields are editable, so I can change the values of the edittexts, change value via Spin etc. No I want to update the SQL Tab. Which is the best way? Have I to iterarte through all "row" in the Scrollview, so if I have e.g. 30 rows I have to do 30 Update statement on the Database?
Or delete all Rows in the tab and iterate through the rows of the Scrollview and use insert into statements (would be 30 SQL Statements, too)?
Or is there a better way?

Thx4hlp,
NoName
 

mc73

Well-Known Member
Licensed User
Longtime User
Create a list containing the ids of records that have been edited, and update just these through your queries, while using the sql.begin/endtransaction in order to make it faster.
 
Upvote 0
Top