MySQL - Insert
On this Page
Overview
You can use this Snap to execute a SQL Insert statement.
Snap Type
The MySQL - Insert Snap is a Wrte-type Snap.
Prerequisites
None.
Support for Ultra Pipelines
Works in Ultra Pipelines when batch size is set to 1.
Known Issues
None.
Limitations
Behavior Change
Previously, when you passed Date/DateTime value for the Year data type column, the MySQL Insert Snap inserted the value into Year data type.
With the 4.37 GA release, when you pass a Date/DateTime value for the Year data type column, the Insert Snap does not accept those values and fails with an error. We recommend that you pass only year values for the Year data type. This is the expected behavior of the Snap.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
|---|---|---|---|---|
Input | Binary
|
|
| This Snap has two input views but by default it has one input view. |
Output | Document
|
|
| This Snap has at most one document output view. If an output view is available, then the original document that was used to create the statement will be output with the status of the insert executed. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. Database write Snaps output all records of a batch (as configured in your account settings) to the error view if the write fails during batch processing. | |||
Snap Settings
Asterisk (*): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon (): Indicates that you can add fields in the field set.
Remove icon (): Indicates that you can remove fields from the field set.
Field Name | Field Type | Description |
|---|---|---|
Label*
Default value: MySQL - Insert | String | Specify 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. |
Schema name
Default value: None | String/Expression/Suggestion | Specify the database schema name. In case it is not defined, then the suggestion for the Table Name will retrieve all tables names of all schemas. The property is suggestable and will retrieve available database schemas during suggest values. The values can be passed using the pipeline parameters but not the upstream parameter.
|
Table name*
Default value: None | String/Expression/Suggestion | Specify the name of table to execute insert on. The values can be passed using the pipeline parameters but not the upstream parameter. |
Create table if not present
Default value: Deselected | Checkbox | |
Number of retries
Default Value: 0 | Integer/Expression | Specify the maximum number of attempts to make to receive a response. The request is terminated if the attempts do not result in a response.
|
Retry interval (seconds)
Default Value: 1 | Integer/Expression | Specify the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception. |
Use MySQL INSERT IGNORE option
Default Value: Fail | String/Expression | Choose an option to instruct the Snap to ignore the SQL errors encountered during execution. If the target table contains no primary key constraint, and the 'Use MySQL INSERT IGNORE option' is set to ignore, then the Snap inserts null values into MySQL when you attempt to insert invalid data. To ensure that all data truncation / validation errors are caught in the error view, set the 'Use Mysql INSERT IGNORE option' to Fail. |
Snap Execution
Default Value: Execute only | Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.