query to set sql database column value in android studio

I am trying to set the column value to String.

This is the method from DatabaseHelperClass:

  public void setDate(String name, String date){
    SQLiteDatabase db = this.getWritableDatabase();
    String query = " SET " + COL3 + " TO " + date + " FROM " + TABLE_NAME +
            " WHERE " + COL2 + " = " + name;
    db.execSQL(query);

And the class where i want to set the date:

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.elevator_info);

    myDB = new DatabaseHelper(this);
    btnAddDate = (Button) findViewById(R.id.btnAddDate);
    editText = (EditText) findViewById(R.id.editTextDate);

    Intent receivedIntent = getIntent();
    selectedID =  receivedIntent.getIntExtra("id", -1);
    selectedName = receivedIntent.getStringExtra("name");

    btnAddDate.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
           String newDate = editText.getText().toString();
            myDB.setDate(selectedName,newDate);
        }
    });

}

This is my logcat:

 E/SQLiteLog(8210): (1) near "TO": syntax error
 D/AndroidRuntime(8210): Shutting down VM
 E/AndroidRuntime(8210): FATAL EXCEPTION: main
 E/AndroidRuntime(8210): Process: com.example.goshoy.elevatorapp, PID: 8210
 E/AndroidRuntime(8210): android.database.sqlite.SQLiteException: near "TO": 
 syntax error (code 1): , while compiling: SELECT date TO date1 FROM 
 elevatordatabase WHERE name = bag6

i did this :

String query = " UPDATE " + TABLE_NAME + " SET " + COL3 + " = " + 
date + " WHERE " + COL2 + " = " + name;

logcat:

E/AndroidRuntime(10063): android.database.sqlite.SQLiteException: no such 
column: date1 (code 1): , while compiling: UPDATE elevatordatabase SET date 
= date1 WHERE name = bag

Soo i did this :

 SQLiteDatabase db = this.getWritableDatabase();
    ContentValues cv = new ContentValues();
    cv.put(COL3,date);
    db.update(TABLE_NAME , cv , COL2 + " = " + name, null);

Logcat:

     E/AndroidRuntime(12444): 
     android.database.sqlite.SQLiteException: no such column: bag4 
     (code 1): , while compiling: UPDATE elevatordatabase SET date=? 
     WHERE name = bag4

Check this:

Syntax of UPDATE query with WHERE clause.

UPDATE table_name
SET column1 = value1, column2 = value2...., columnN = valueN
WHERE [condition];

Reference

use this one

String query = "update "+TABLE_NAME +" SET " + COL3 + " = '" + date + "'  WHERE " + COL2 + " = '" + name+"'";

add single qoute to ur query for data1 and name.
use this

try this, its really easy:

ContentValues cv = new ContentValues();
cv.put("ColumnName3","Value");
db.update("TABLE_NAME", cv , ID + " = " + YourRowID, null);

this part is a where clause in the above line

ID + " = " + YourRowID