Skip to main content

Execute SQL Script

Description

Execute SQL Script runs SQL statements against a database either once during workflow initialization or once for every input row. Use this step when you need to perform custom database operations that the dedicated steps (Table Output, Table Input, Update, Delete) do not cover — for example, creating temporary tables, running DDL statements, or executing complex stored procedures. Because it uses dynamic SQL rather than prepared statements, it is best suited for administrative or setup tasks rather than high-volume data operations where performance is critical.

Configurations

Field NameDescription
Step nameSpecify the name of the step; This name has to be unique in a single workflow
ConnectionSelect a database connection to use
SQL script to executeSpecify the SQL to execute. Separate statements by; and use question marks as place holders for parameter.

Note: This step does not use prepared statements by default; therefore the given parameters have to be enclosed correctly. Numeric values do not need to be enclosed, but all others e.g. Strings need to be enclosed with quotes or double quotes depending on the database dialect.

Execute for each row?Enable checkbox to execute the SQL for each incoming row. In this case parameters can be used. When this option is unchecked, the SQL statement is executed at the step initialization phase.
Execute as a single statementThis option does not split the statements by; and will send the whole SQL to the database.
Variable substitutionIn case you want to use variables in the SQL, e.g. ${table_name}, this option needs to be checked.
Bind parameters?Check this option to bind parameters using prepared statements, otherwise this step will perform a literal string replacement of the parameters.
Abort connection on stop?Select the checkbox to immediately drop the database connection when stopping a workflow. Use this setting for heavy SQL queries to bypass the waiting for the active query to complete.
If cleared (default), the system sends a standard cancel command and waits for the active query to finish gracefully.
Quote Strings?This option adds quotes around the string according to the database dialect and also escapes special characters like CR, LF and the quote character itself.
ParametersThe list of used parameters that will replace the question marks in the query in the given order. So the first question mark will be replaced by the first parameter, the second question mark by the second parameter etc.

Note: If you need the same parameter multiple times in your query, you need to use multiple question marks. Using a "Select Values" step you can duplicate field values within the "Select & Alter" tab by selecting the value once and renaming it a second or third time.

Field to contain insert stats (Optional)Specify a field name to hold the number or records that where inserted.
Field to contain update statsSpecify a field name to hold the number or records that where updated.
Same as insert stats, but for deleted rows.Specify a field name to hold the number or records that where deleted.
Same as insert stats, but for read rows.Specify a field name to hold the number or records that where read.