Help Centre › Building Processes
Execute an INSERT, UPDATE, or DELETE statement.
Add it to a process
In the process designer, open the Add step tab. Find Execute statement under Database › Query & Execute, or type its name in the search box, and drag it onto the canvas.
Fields
| Field | Required | What it does |
|---|---|---|
| SQL statement | Yes | The SQL query to execute |
| Variable | Yes | Name of the variable where the result will be stored Default: affected_rows. |
| Connection name | Yes | Connection name |
| Parameters (JSON array) | No | Query parameters, one per line (value or key=value) |
| Fail when no rows change | No | Stop with an error when the statement changes no rows, instead of only noting it in the log Default: off. |
What it gives back
{last_insert_id}– Auto-generated key from an INSERT (null if unsupported){affected_rows}– Number of rows affected
See all Database steps.
Errors
| Error | Description |
|---|---|
| Connection not found | No open connection exists with the specified name |
| Query error | The SQL statement contains a syntax error or references invalid objects |
Tips
- Use the params array for parameterised queries to prevent SQL injection
- Check the affected_rows output to verify the expected number of rows were modified
- Wrap multiple execute statements in a transaction (db-begin-transaction / db-commit) for atomicity