system.db.runPrepUpdate("UPDATE

Dear colleagues, let's see if you can help me.
I am trying to update an existing row in my database.
I think I have to use this statement, but I don't know how to point to the row. Nor how to write the rewrite command correctly.

system.db.runPrepUpdate("UPDATE

I leave you my code in case you can help me see where the problem is.
The row is identified by the variable "nombre"

nombre = event.source.parent.getComponent('Desple_recetas_BDD 1').selectedStringValue
Tiro_V_min = event.source.parent.getComponent('Tiro V min 1').intValue
databaseConnection = "BDD_HMI"
system.db.runPrepUpdate("UPDATE INTO recetas (nombre, Tiro_V_min, tstamp) VALUES (?,?,?)", [nombre, Tiro_V_min, system.date.now()], databaseConnection)

I have not been able to locate an example. If they have it, it would also work for me.

Thanks to the entire community

Try:

system.db.runPrepUpdate("UPDATE recetas SET Tiro_V_min=?, tstamp=? WHERE nombre=?", [Tiro_V_min, system.date.now(), nombre], databaseConnection)
1 Like

Hi, Oscar. Please see Wiki - how to post code on this forum. The > markdown syntax is for quoting another source.