Online Documentation for Data Import for MySQL
Step 7 - Specifying import mode
This step of the wizard allows you to define the records processing mode as Insert All, Insert New, Update, Update or Insert, Delete, Delete or Insert mode.
Import Mode
- Insert all: all records from the source file are inserted into the tables irrespective of whether any records exist in the destination table or not
- Insert new: already existing records are skipped, and new records are inserted into the destination table
- Update: all existing records are updated from the source file
- Update or insert: already existing records are updated and new records are inserted into the destination table
- Delete: already existing records are deleted
- Delete or insert: existing records are deleted and new records are inserted into the destination table
Here is an example of some import modes offered by Data Import utility:
DB Table |
Source file |
|
|
All import modes (except for the Insert All mode) are based on primary key values information. In order to perform import operations with these modes used you need to have matches between the source file primary key column(s) and the destination table primary key column(s).
Insert mode |
Insert all |
Insert new |
Update |
Result |
|
|
|
Insert mode |
Update or insert |
Delete |
Delete or insert |
Result |
|
|
|
It is applied to all other import modes, except for the Insert all mode. For all these modes (except for the Insert all mode) it is obligatory to select the primary key fields. This field (or fields) is used as key field to identify specific data in the target database.
The key columns for these operations are defined at the Selecting key columns step of the wizard.
If the Update value is selected for Import Mode, then you need to specify the Primary Key field(s) that will serve for data identification of your source file with the data of the target table. The source file must contain the column(s) that will correspond to the Primary Key field of the target table. If the target table contains a record in which the value of the primary key field coincides with the value of the corresponding column of the source table, the data stored in this table record will be updated. You can specify the field(s) which will be used for identification at Step 7 of the wizard. This field(s) will only serve for identification and will not be imported.
Native mode kind
The Native mode of uses the Single Commands method that serves to generate and execute single SQL commands on the server. If necessary, you can use the Batch Insert mode to import a data set as a batch. In the CSV Insert mode data are inserted as a set of comma-separated values.
The Duplicate solution group defines handling of imported rows that duplicate existing rows by Unique key values:
Replace
Imported rows replace existing rows. In other words, the rows that have the same value for a Primary key or Unique index as existing rows are replaced.
Ignore
Imported rows that duplicate existing rows by a Unique key value are skipped.
Temporary File Name
Type in or use the button to specify the name and path to the temporary file which stores data to be inserted in the CSV Insert mode.
Skip this step
Check this option to skip the current step in the future. To edit the list of skipped steps, use the Skipped Steps group available in the General section of the Preferences dialog.
When you are done, press the Next button to proceed to the next step.