Execute Non Query
Executes a SQL non-query command (INSERT, UPDATE, DELETE) on a SQLite database.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The identifier of the database connection to use.
- Transaction Id - The identifier of the transaction to use (optional).
- SQL Query - The SQL non-query command to execute (supports template variables).
Output
- Number Of Affected Rows - The number of rows affected by the SQL command.
How It Works
The Execute Non Query node runs a SQL command that doesn't return data (INSERT, UPDATE, DELETE). When executed, the node:
- Validates the provided Connection Id input
- Looks up the database connection in the SQLite connection pool
- If provided, looks up the transaction in the SQLite transaction store
- Deserializes message data for use in SQL template variables
- Renders the SQL query using template variables with Stubble template engine
- HTML decodes the rendered SQL query
- Creates and executes a SQLite command with the rendered query using ExecuteNonQuery()
- Returns the number of affected rows as output
Requirements
- A valid database connection identifier from the Connect node
- Valid SQL non-query command (INSERT, UPDATE, DELETE)
- Sufficient database permissions for the requested operation
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Connection Id
- Connection with the specified Id not found
- Invalid SQL query
- Database connection issues
- Transaction with the specified Id not found (if Transaction Id is provided)
- Insufficient permissions for the database operation
Usage Notes
- The SQL Query field supports template variables using double curly braces (e.g.,
{{variableName}}
) - Template variables are populated from the message data
- The Number Of Affected Rows output indicates how many rows were modified by the command
- If a Transaction Id is provided, the command will be executed within that transaction
- This node is specifically for non-query commands and should not be used for SELECT statements
- For SELECT statements, use the Query node instead