Tools - Database Export Wizard

This wizard allows you to quickly export data from the database to a file.

The tool has a user-friendly interface that guides you by the hand through all the steps of exporting data.

Each step is a separate page. You can navigate through the boards using the Next and Back buttons. not all boards will always be visible - it depends on the options you select, as well as how you run the wizard.

Launching

You can run the wizard with commands in the pop-up menu of the two tree items of the MySQL Inspector tab (the command icon is shown next):

Database name - Export content
Launches a wizard with presets suitable for exporting the contents of the current database. A page for selecting the tables to be exported is immediately displayed.

Table name - Export content
Launches a wizard with presets suitable for exporting the contents of the selected table. The first page is displayed (see below) with the default export setting of the clicked table.

Scope of data to export

The first screen of the Wizard allows you to select one or more tables from which the data is to be exported, or to enter a query that will be executed to retrieve data from the database.

In case the Wizard has been started for exporting the entire database (from the context menu of the 'Database Name' branch), this page will be skipped. However, you can navigate to it by pressing the 'Back' key.

Choose what you want to export by selecting the appropriate option:

Single table
Check this option to activate the drop-down list to select the table whose entire contents you want to export. On the next page, you will be able to see the results of the query in the form of a table.

Several tables, or the entire database
Check this option to be able to select one or more tables for data export on the next page.

Query result
Check this option to activate the field for entering your own query. On the next page you will be able to preview the results. To the right of the text box are buttons:

  • SQL Query Wizard
    Launches the SQL Query Wizard to help build a simple query that retrieves data from no more than one table.
  • Get a command from the current document
    Allows you to read and enter into the text box next to a query from the current document in the editor.
  • Get a command from a file
    Allows you to read and enter into the text field next to a query from a SQL file stored on disk.
  • Favorite SQL Queries
    Displays a list of Favorite SQL qu eries to select the query you want to execute.

Select tables to export

The "Selecting tables to export" page will be displayed in two cases:

  • when you select on the first page the option to export several tables, or the entire database,
  • when you run the Wizard for exporting the entire database (from the context menu for the"Database Name" branch of the tree on the MySQL Inspector tab)

Most of it is taken up by the list of tables of the current database. Select one or more of them. If you want to select or deselect all tables, use the buttons below. Below the list you will also find information on how many tables are selected. You must select at least one table to proceed further.

Preview exported data

The "Exported Data Preview" page will only be displayed if you select the Single Table export option on the first page (option one), or execute a custom SQL query entered into the text field (option three).

It is purely informative - it displays an inspector that is filled with data to be exported. If you are satisfied with the result, you can click Next to move to the next page, where you choose the format to which the data will be exported.

Format selection

The next page allows you to select the format into which the data from the database will be exported. The following options are available:
  • HTML - The data will be exported as HTML documents, where the data will be placed in a table, the first line of which will be a header containing the names of the fields.
  • XML - Data will be exported to XML documents in the form of like:
    <table_name>
     <row>
        <field_1>value 1_1</field_1>
        <field_2>value 1_2</field_2>
        <field_3>value 1_3</field_3>
      </row>
      <row>
        <field_1>value 2_1</field_1>
        <field_2>value 2_2</field_2>
        <field_3>value_3</field_3>
      </row>
    </table_name>
  • CSV - The data will be exported as CSV files (fields separated by semicolons), where the first line will contain the names of the table fields, and the following lines will contain the data.
  • RTF (Rich Text Format) - The data will be exported as RTF documents, containing a table of data. The first row will be the header, while subsequent rows of data will have alternating white and light gray backgrounds for easier orientation.
  • MS Excel - The data will be exported to an MS Excel document.
  • SQL INSERT commands - the data will be exported to a file containing SQL commands, which allows you to import them back into the database later. In addition, you can select options:
    • includeCREATE TABLE command
      Check this switch if you want the exported table creation commands to be generated
    • include the command to delete a table (DROP TABLE IF EXISTS)
      Check this switch if you want a delete command to occur before the command to create a table with a given name. It is especially important if data from the file you have just exported will later be imported into a database where tables with such names may already exist. This will avoids the error of trying to create a table with the same name.
    • Including the command to insert data into the table (INSERT INTO)Check this switch if you want the tool to export the downloaded data to SQL format (which will allow you to import it into the database later)
      • Use REPLACE instead of INSERT - If you enable this option, the resulting SQL file will use REPLACE statements instead of INSERT.
      • use INSERT with IGNORE - If you enable this option, there is an additional IGNORE command in the INSERT commands, so you can get around the problem of importing records already present in the table. They are ignored.
      • INSERT/REPLACE commands without field names - If you enable this option, the INSERT or REPLACE commands will not include field names, so the resulting SQL file can be much smaller (especially for a large number of records).

Choose the export destination

The last page contains options to specify the destination for the exported data. This can be a file saved on disk, export to the clipboard, or to a document in the editor. Not all options will always be available. For example, in a situation where you are exporting data from multiple tables to HTML format, the only option will be to save it to disk (which is logical, since, for example, a file in RTF format cannot be directly edited in Spider, so you can only save it to disk).

The following options are available:

Export to file
Check this option to save the finished file to disk. If you are exporting data from a single table, or from a custom query, enter the path and file name of the destination file. If you are exporting from multiple tables, enter the path and file name template, and you can use the asterisk symbol (*), which will be replaced by the name of the exported table when saving the file to disk. For convenience, you can use the button next to the field, which opens a dialog box for indicating the path and file name. After selecting the appropriate option placed below, the newly created document can be opened in Spider for editing.

Export to clipboard
Check this option to put the exported data in the selected format on the Windows clipboard for later use. This option is not available when exporting from multiple tables.

Export to editor
Check this option to paste the exported data in the selected format into the editor. Two options are available:

  • create new document - a new document will be created, to which data will be exported. In addition, a coloring scheme, selected according to the previously selected data format, will be applied to this document by default.
  • Insert at cursor position - will paste the data in the current document at the cursor position (this option is not available when exporting from multiple tables).

Include a CSS sheet
You can attach a CSS stylesheet to the exported HTML file (this option is only available for HTML exports). To do this, enter the path to the stylesheet file in this field. To make it easier, you can use the dialog box opened by the button next to it.

End of work

After setting all the options, the last action is to click Finish. The data will be exported, while the wizard will terminate.

Related topics

To top