Basically I have a local database of some tables with some records that occasionally have modifications.
When I start the application I get the last update data from the remote MySQL database.
If the data differs from what is recorded in the local database, I query all records and update them. When finished, I update the date and time data that I have in the remote database so that they do not have differences again and thus load again and again. I don't know why the UPDATE statement doesn't work. It does not return any errors.
What could I be forgetting?
When I start the application I get the last update data from the remote MySQL database.
If the data differs from what is recorded in the local database, I query all records and update them. When finished, I update the date and time data that I have in the remote database so that they do not have differences again and thus load again and again. I don't know why the UPDATE statement doesn't work. It does not return any errors.
What could I be forgetting?
B4X:
Public Sub set_federations_map(mapRecords As Map, strDateTime As String)
Dim sqlSelectUpd As SQL
sqlSelectUpd.Initialize(xui.DefaultFolder, "strings.db", False)
sqlSelectUpd.ExecNonQuery("DELETE FROM cmn_lst_federaciones")
sqlSelectUpd.BeginTransaction
For Each intID As Int In mapRecords.Keys
Dim strDescShort As String = mapRecords.Get(intID).As (List).Get(0).As (String)
Dim strDesc As String = mapRecords.Get(intID).As (List).Get(1).As (String)
sqlSelectUpd.ExecNonQuery2("INSERT INTO cmn_lst_federaciones VALUES (?, ?, ?)", Array As Object(intID, strDesc, strDescShort))
Next
sqlSelectUpd.TransactionSuccessful
sqlSelectUpd.EndTransaction
sqlSelectUpd.ExecNonQuery("UPDATE cfg_last_update SET updated = '" & strDateTime & "' WHERE table_id = 'cmn_lst_federaciones'")
sqlSelectUpd.Close
End Sub