Hi all, i have this code with some trouble, i have 85000 records and has a time of 10 minutes aprox. Sometimes take 45 seconds(only a few times), i dont know why, same conditions, i dont understand...
any one has an idea? need i change the code?
any one has an idea? need i change the code?
Insert perform:
Sub btnLote_Click
ProgressDialogShow("Cargando Lotes...")
Wait For (Connect) Complete (Success As Boolean)
If Success Then
Try
Dim sf2 As Object = mysql.ExecQueryAsync("mysql", "Select * from lote;",Null)
Wait For (sf2) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
If Success Then
Main.DBLocalWMS.BeginTransaction
Try
Main.DBLocalWMS.ExecNonQuery("Delete from lote")
Do While Crsr.NextRow
i = i + 1
AuxCodigo = Crsr.GetInt("codigo")
AuxLote = Crsr.GetString("lote")
AuxUMB = Crsr.GetString("umb")
AuxVenc = Crsr.GetString("vencimiento")
Main.DBLocalWMS.AddNonQueryToBatch("Insert into Lote values(?,?,?,?)",Array As Object(AuxCodigo,AuxLote,AuxUMB,AuxVenc))
Loop
Main.DBLocalWMS.ExecNonQueryBatch("mysql")
Main.DBLocalWMS.TransactionSuccessful
Catch
Log(LastException.Message)
End Try
Main.DBLocalWMS.EndTransaction
Crsr.Close
End If
Catch
Success = False
Log(LastException)
End Try
CloseConnection
ProgressDialogHide
End If
End Sub