I am working on the SQL tutorial at https://www.b4x.com/android/forum/threads/sql-tutorial.6736/#content
I seem to have pretty much understood the example project.
Now I am modifying it to get to what I need. I have this grid showing data, a bit like a spreadsheet, and the user may modify one of the cells.
I am trying to update one field only in one row.
All the example I could find on the Internet require that the value of a field be a condition. But I found an example of modifying a field without condition at the bottom of https://www.w3schools.com/sql/sql_update.asp
I tried to adapt that to the example project here :
I was expecting that col1 contains "tata" after the update, but it remains the same. No error was generated, though.
I will appreciate any help.
I seem to have pretty much understood the example project.
Now I am modifying it to get to what I need. I have this grid showing data, a bit like a spreadsheet, and the user may modify one of the cells.
I am trying to update one field only in one row.
All the example I could find on the Internet require that the value of a field be a condition. But I found an example of modifying a field without condition at the bottom of https://www.w3schools.com/sql/sql_update.asp
I tried to adapt that to the example project here :
B4X:
Cursor1.Position = 0
SQL1.BeginTransaction
Try
SQL1.ExecNonQuery("UPDATE table1 SET col1='tata'")
SQL1.TransactionSuccessful
Catch
Log(LastException.Message)
End Try
SQL1.EndTransaction
Log("Cursor1.position " & Cursor1.position)
Log("colonne 1: " & Cursor1.GetString("col1"))
I was expecting that col1 contains "tata" after the update, but it remains the same. No error was generated, though.
I will appreciate any help.