I've been trying a bunch of different ideas including batch updates but the SQL update process still takes about 1.25 seconds per record on a Galaxy Tab E. and 1/2 that on the S9. I also tried adding indexes on relevant fields with no noticeable improvement. Are there any other techniques for increasing the speed of this Update Command
B4X:
Cursor1 = Starter.SQLBN.ExecQuery("SELECT ASSETNO, MCNO, QTYORD, ASQTY FROM wcUdfAsTbl WHERE JOBNO = '" & mJobNo & "' AND MCNO = '" & mMCNo & "'")' ORDER BY DSPORD")
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
mAssetNo = Cursor1.GetString("ASSETNO")
Query = "UPDATE wcUDFAsTbl Set OBNO = ?, ASTRTYPE = ?, ASSTATUS = ?, QTYOB = ?, ExcCode = ?, ExcQty = ?, ASCOND = ?, Loaded = ?, DriverNo = ?, Driver = ?, Route = ?, UDF2 = ?, OBTX = ?, MDate = ?, MTime=?, OBDate = ?, OBTime = ?, MSTAT = ?, RECSTAT = ?, Posted = ? WHERE AssetNo = " & Cursor1.GetString("ASSETNO")
Starter.sqlBN.BeginTransaction
Try
Starter.sqlBN.ExecNonQuery2(Query, Array As String(Starter.gOBNo,"OB","P1", Cursor1.GetString("ASQTY"), mExc, edExcQty.text, mCond, "True", Starter.gDrvrNo,Starter.gDrvr,Starter.gRte, mCurLoc, "OB", DateTime.Time(DateTime.Now), TNow, DateTime.Time(DateTime.Now),TNow, "O", mRS, "P"))
Starter.sqlBN.TransactionSuccessful
Catch
Log(LastException.Message)
End Try
Starter.sqlBN.EndTransaction
Next
Cursor1.Close