Exporting a Schema
Only in DbVisualizer Pro
This feature is only available in the DbVisualizer Pro edition.
Using the Export Schema dialog, you export all or some of the objects in a schema to a file, an SQL Commander tab or the clipboard.
- In the Databases tab, right-click the schema and select Export Schema. The name depends on the database: for example, for MySQL, right-click the database and select Export Database.
- Choose the Output Format, the Output Destination, the objects and the Options, as described below.
- Click Export.
Choosing the format
You can export to CSV, HTML, SQL, TXT, XML, Excel or JSON.
- SQL and XML contain the DDL of all objects, and optionally the data of tables and views.
- The other formats contain only the data of tables and views.
For SQL, the DDL and the INSERT statements use delimited identifiers and qualified names as set in the connection properties. You can change this for one export in Options.
Choosing the destination
Export to one of these:
- A file.
- An open or a new SQL Commander tab. For an open tab, choose where to insert the text.
- The clipboard.
Choosing the objects
In the Object Types area, select the objects to export. Select an object type to export all objects of that type, or expand it and select single objects. To export all objects, select the schema at the top.
Options
The Options area has options for all formats at the top, and options for the selected format below them. For example, for SQL and for Excel:


For Excel, you can export to XLSX, the default, or to the older XLS format. For XML, you can choose the DbVisualizer format, the default, or one of the DbUnit formats, XmlDataSet and FlatXmlDataSet.
Other formats have options such as delimiters, a title and a description. The dialog uses the @export command, so all options are described in Exporting Results (@export).
The data formats, such as the formats of dates and numbers, are by default the ones set in Tools → Tool Properties. To use other formats for the export, for example because you will import the data into another type of database, click Data Format Settings. In the Data Format Settings dialog, you can also choose how to quote text values and handle quotes in them.
Databases write date, time and timestamp literals differently. If you export to SQL from one type of database and run the script in another type of database using DbVisualizer or another JDBC client, choose the JDBC escape format for these values. The driver then turns the values into the format of the target database.
Using variables in fields
In the file name and in the text fields, such as the title and description, you can use these predefined variables: ${dbvis-date}$, ${dbvis-time}$, ${dbvis-timestamp}$, ${dbvis-connection}$, ${dbvis-database-type}$ and ${dbvis-object}$.
To export each object to a file of its own, use ${dbvis-object}$ in the file name. It is replaced with the object type and name. For example, ${dbvis-object}$.sql becomes table_COUNTRIES.sql for the table COUNTRIES.
Exporting to Excel
Excel doesn't keep the formats of dates, times and timestamps. To get the right format, select Export Date/Time as Text, or set the format in Excel.
The Excel formats have these limits:
- A text value can have at most 32,767 characters. If a value is longer, the export stops with an error. To export longer values, shorten them in a query, for example using
SUBSTR, or export to CSV instead. - XLSX allows at most 1,048,576 rows in a sheet.
- XLS allows at most 65,535 rows and 256 columns in a sheet.
Saving the settings
If you often use the same settings, save them, using the Settings menu button:
- Save As Default Settings: Use the current settings as the defaults the next time you open the dialog.
- Use Default Settings: Go back to the saved default settings.
- Remove Default Settings: Remove the saved defaults, and go back to the original defaults.
- Save As and Load: Save the settings to a file, and load them from a file.
- Copy Settings to Clipboard: Copy the settings, for example to use them in a script.