Database: Execute statement

Execute an INSERT, UPDATE, or DELETE statement.

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

FieldRequiredWhat it does
SQL statementYesThe SQL query to execute
VariableYesName of the variable where the result will be stored Default: affected_rows.
Connection nameYesConnection name
Parameters (JSON array)NoQuery parameters, one per line (value or key=value)
Fail when no rows changeNoStop 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

ErrorDescription
Connection not foundNo open connection exists with the specified name
Query errorThe 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

Related functions

Get started

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or have your first automation working in 7 days.