java - Update table field value to null programmatically -
It's well known how to clear field values, such as with a simple query -
Set your_ table your_column = NULL WHERE id = 1; but pro-grammatically, which is the correct way to update field value for zero -
db.execSQL ("your_state update Your_column = '"+ blank +" WHERE id =' "+ myid +" ''); OR
db.execSQL ("your _table set your_column = NULL WHERE id = "+ myid +" ''); thanks
I will go together
string query = "set your_table your_column =? WHERE id =?"); Statement made stmnt = conn.prepareStatement (query); If (colyouAretryingtopass == faucet) {] stmnt.setNull (1, type .VARCHAR); }
Comments
Post a Comment