Freelance Project Requests Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net

Sqlite: change values



How can you change a record in SQLite?


In SQLite, as with all SQL databases, a record is changed using the UPDATE statement.

In the process, a record is changed with UPDATE table SET target field = new value.

In databases, it is best to always change using the unique ID so that only a single record is changed.



Update in SQLite


Code example in Java, SQLite

public void save_Note_byID(Integer IDNote, String sTitle){
//--------< update_Note_byID() >--------
SQLiteDatabase db = this.getWritableDatabase();
    String sSQL =
"UPDATE tbl_Notes " +
" SET [Title] = '" + sTitle + "'"    +
" WHERE IDNote=" + IDNote ;
//< run >
//</ run >
    //--------</ update_Note_byID() >--------





Calling the change to SQLite database

In this case, a .Save method of the SQLite database is called.

Under Android Java SQLite, the database class writes storage methods for external access. The user-specific .Save or .Update method can be found in the database class.



Android app-> java-> project->

public void btnSave_Clicked(View view) {
//------------< btnSave_Clicked() >------------
    //*save recordset by ID
    //< get fields >
TextView lblID=findViewById(;
    String sID=lblID.getText().toString();
    Integer ID=Integer.parseInt(sID);
    EditText edit=findViewById(
    String sTitle=edit.getText().toString();
//</ get fields >

    //< save Datase >
//</ save Dataset >

    //------------</ btnSave_Clicked() >------------




Using the SQLite database on a page

The database class is usually tied in the Android app when an activity page is opened.

clsDatabase _db; //=new Database(this);
protected void onCreate(Bundle savedInstanceState) {
..    //< init >
_db=new clsDatabase(this);








Contact for Jobs, Project Requests: