Skip to main content

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:

  1. Validates the provided Connection Id input
  2. Looks up the database connection in the SQLite connection pool
  3. If provided, looks up the transaction in the SQLite transaction store
  4. Deserializes message data for use in SQL template variables
  5. Renders the SQL query using template variables with Stubble template engine
  6. HTML decodes the rendered SQL query
  7. Creates and executes a SQLite command with the rendered query using ExecuteNonQuery()
  8. 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