Redshift - Multi Execute

Redshift - Multi Execute

This page is no longer maintained (May 13, 2026). For the most current information, go to Redshift - Multi Execute.


On this Page

Snap Type:

Write

Description:

This Snap is used to execute multiple Redshift SQL statements sequentially inside of a single BEGIN and END transaction for each input document. If an SQL statement fails, subsequent SQL statements are not executed and error output goes to the error view (if the corresponding option is selected). If all statements are successful, all output results go to the output view. Data can be written to both output and error view if using multiple input documents. Use this Snap to perform updates to Redshift data that would otherwise be done in a Stored Procedure.

Select statements that return data results, and transaction sql statements such as begin, end, commit and rollback are not supported. 

ETL Transformations & Data Flow


This Snap enables the following ETL operations/flows:

The Snap executes a sequence of multiple Redshift DDL commands in a sequential order as specified in the Executions section and the result will be written to the output view which contains results from individual queries that have been executed from the provided properties. If any submitted query fails, the Snap will throw an exception and rollback changes from prior queries.

Input & Output:

  • Input: The Snap can have zero to one input document to trigger multi-executions of SQL statements and any necessary field data values if expressions are used in the SQL executions.

  • Output: The output results will be written to the output view. 

Upstream & Downstream Snaps

  • Expected Upstream SnapsUpstream Snap is not required - the MultiExecute Snap will execute once if no input view is defined. However, if there is an upstream Snap, it should only produce documents to trigger the MultiExecute Snap. For example, if zero documents are produced by an upstream Snap, the MultiExecute SQL will not execute. If two documents are produced, the MultiExecute will execute twice, once for each input document (the original input document data will be preserved in the output views) 

  • Expected Downstream Snaps: Applicable downstream Snaps to handle the possible Redshift SQL data results emitted on the output and error view can be used.

 

A BEGIN and END statement are prepended and appended, respectively, to the MultiExecute SQL automatically by the Snap.  The result of these statements is added to the output and error views.

Prerequisites:

None

Limitations and Known Issues:

  • Works in Ultra Tasks.

  • SELECT statements are not accepted for execution.

  • Does not support transaction, commit, and rollback operations.

Configurations:

Account & Access

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Redshift Account for information on setting up this type of account.

Views

Input

This Snap can have at most one input view.

Output

This Snap has at most one output view.

Error

This Snap has at most one error view and produces zero or more documents in the view.

Troubleshooting:

[None]

Settings

Label

 

Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Executions

 

 

Required. Specifies the SQL statement to execute on the server.  

Examples: 

  • create table stage_table as select * from leads l where l.value not in (select h.value from leads_hist h);

  • insert into leads_hist select * from stage_table;

  • drop table stage_table; 

Caution

Using expressions that join strings together to create SQL queries or conditions has a potential SQL injection risk and hence unsafe. Ensure that you understand all implications and risks involved before using concatenation of strings with '=' Expression enabled. 

Single quotes in values must be escaped

Any relational database (RDBMS) treats single quotes (') as special symbols. So, single quotes in the data or values passed through a DML query may cause the Snap to fail when the query is executed. Ensure that you pass two consecutive single quotes in place of one within these values to escape the single quote through these queries.

For example:

Default value: [None]

 

Troubleshooting

Error

Reason

Resolution

Error

Reason

Resolution

type "e" does not exist

This issue occurs due to incompatibilities with the recent upgrade in the Postgres JDBC drivers.

Download the latest 4.1 Amazon Redshift driver here and use this driver in your Redshift Account configuration and retry running the Pipeline.