MySQL Execute

Overview

The MySQL - Execute Snap enables you to execute custom SQL statements and queries on a MySQL database. This Snap supports both DDL (Data Definition Language) and DML (Data Manipulation Language) operations, providing flexibility for database schema modifications, data manipulation, and administrative tasks.

You can use this Snap to execute CREATE, ALTER, DROP, TRUNCATE statements for schema operations, or execute stored procedures and complex SQL operations that require custom SQL beyond standard CRUD operations.

Prerequisites

A valid account with the required permissions to execute SQL statements in the target MySQL database.

Snap views

Type Description Examples of upstream and downstream Snaps
Input Optional.This Snap has at most one document input view. If an input document is provided, it can be used to provide values for SQL statement parameters using expressions.
Output Each output document contains the execution result, including the number of rows affected and any result sets returned by the SQL statement.
Learn more about Error handling.

Snap settings

Legend:
  • Expression icon (): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field/Field set Description
Label

String
Required.

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: MySQL Execute

Example: MySQL Execute
SQL Statement

String/Expression

Required.The SQL statement to execute. You can use expressions to reference values from the input document. Supports DDL statements (CREATE, ALTER, DROP, TRUNCATE) and DML statements (INSERT, UPDATE, DELETE) as well as stored procedure calls.

Example: CREATE TABLE employees (id INT, name VARCHAR(100), department VARCHAR(50))

Example: DROP TABLE IF EXISTS temp_table

Number of Retries

Integer

Optional.The number of times the Snap should retry the operation in case of failure.

Default value: 0

Retry Interval (seconds)

Integer

Optional.The time interval in seconds between retry attempts.

Default value: 1

Snap execution

String/Suggestion

Select one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.
  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Examples