Statemente update sqlite matlab problem
Afficher commentaires plus anciens
Hello guys, I'm trying to use the command execute to make an update to a sqlite database. I'm on 2022b version, so I can't use sqlupdate command.
If I write this code it works:
statementUpdate = ["UPDATE acquisition_table SET model = '" + app.model + "' WHERE ID = 3 "];
execute(conn,statementUpdate) obviously after having estabilished a connection with my database.
If you notice, in the the statement there is app.model. It is a variable which is updated trhough app designer (model is a property) and so I can write that value modified in my database. I'd like to do the same with ID, which I also have set like a property, but I don't know how to modify that statement. It's probably something related to the position of quotes or the apostrophe, I don't know. I need this because that ID is a filter I use to enter in my database, and it changes when I do some stuffs in my app desinger interface. So having it like a fixed value (WHERE ID = 3 for example) is completely useless for me.
Edit: I forgot to say that statement has been suggested to me, so I have doubt also about the use of + symbol
Thanks guys.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB Interface to SQLite dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!