Hi,
I am trying to update a record in the MySQL database, however if the record doesn't exists I want to add it.
I can update the record by doing:
However, I am not sure if there is a query I can use to detect if the record wasn't updated and the add it ?
Anyone know if there is a way in updating the record if it doesn't update then to insert it ?
I am trying to update a record in the MySQL database, however if the record doesn't exists I want to add it.
I can update the record by doing:
B4X:
Dim item, Account, location As String
item = "123"
Account = "ABC"
location = "Test"
sql.ExecNonQuery2("Update Table SET Item = ? WHERE Account = ? AND Location = ?",Array (item,Account,location))
However, I am not sure if there is a query I can use to detect if the record wasn't updated and the add it ?
Anyone know if there is a way in updating the record if it doesn't update then to insert it ?