Android Question SQL change one field on one row


Well-Known Member
Licensed User
I am working on the SQL tutorial at

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

I tried to adapt that to the example project here :
    Cursor1.Position = 0
        SQL1.ExecNonQuery("UPDATE table1 SET col1='tata'")
    End Try
    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.


Licensed User
I think the value comes from an earlier sql execution.

ExecNonQuery doesn't return a record set if I recall right and I don't see where you do a new select statement (after the update) before you read out the cursor.
Upvote 0


Licensed User
What exactly do you want to do ?

Change the data of one column in one specific row?

The code you show:
SQL1.ExecNonQuery("UPDATE table1 SET col1='tata'")
will change the data of col1 in all rows to tata!

To change the data in a specific row , your code should be like this:
SQL1.ExecNonQuery("UPDATE table1 SET col1='tata' WHERE rowid = xxx")
You need a reference ID to the specific row this could be the intrnal rowid or a specific column with the ID.

You may have a look at the SQLite Database Booklet, it contains several example projects.
Upvote 0