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.
- This is a Write-type Snap.
Works in Ultra Tasks
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
- 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.
| 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
|
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
|
Optional.The number of times the Snap should retry the operation in case of failure.
Default value: 0 |
||
| Retry Interval (seconds)
|
Optional.The time interval in seconds between retry attempts.
Default value: 1 |
||
| Snap execution
|
Select one of the three modes in which the Snap executes. Available options are:
|
||