I am adding many records from the response to a HttpUtils2 PostString into my SQLite db on my device. I just want to know if there is a faster way other than looping through each row in the response and executing this code:
you are writing to an sqlite db on your device, yes?
try to use transactions...
B4X:
Sub InsertManyRows
SQL1.BeginTransaction
Try
For i = 1 To 500
SQL1.ExecNonQuery2("INSERT INTO table1 VALUES ('def', ?, ?)", Array As Object(i, i))
Next
SQL1.TransactionSuccessful
Catch
Log(LastException.Message)
End Try
SQL1.EndTransaction
End Sub
I see the Insert statement is different to my original statement in your suggestion. I guess that I can do something like this or does it have to be an array, as I already have it in a response JSON string.. ?