I have a table in react native SQLite with 2 columns app_name,key
I want to update a value if it exists based on app_name else insert new data I tried the following
db.transaction(function (tx) {
tx.executeSql(
'Insert or Ignore Into client_registration (app_name, key) values(?,?); UPDATE client_registration SET app_name=?, key=? where changes() = 0 and "app_name" = ?;',
['coin', 123],
(tx, results) => {
if (results.rowsAffected > 0) {
console.log('success')
);
} else console.log('Registration Failed');
},
);
});
i am unable to ge any output .