SyncriTab

Exporting & Importing Data

Save query results as a file, turn them into INSERT statements, or copy them into a table in another database. You can also load data from a text file into a table.

Which way to export

ToUse
Quickly save results you're looking at Download Data in the results grid's right-click menu. See The right-click menu.
Save a table as a delimited file with your choice of delimiter Export To Text in the catalog's right-click menu. See Exporting a table from the catalog.
Export as CSV, Excel, HTML, or INSERT statements, email the file, copy rows into another database, or set up an export to run on a schedule The Export wizard.

The Export wizard

The Export wizard exports the rows returned by a SELECT statement.

  1. In the SQL editor, write the SELECT statement. If the page holds other statements too, select just this one.
  2. Choose Query › Export.
  3. On the Destination page, choose where the data should go:
  4. Optionally, enter a Friendly name. SyncriTab saves the export under that name so you can run it again later with the Task Scheduler. See Saving an export for the scheduler. Leave it blank for a one-time export.
  5. Click Next, fill in the next page, and click Finish.
The first page of the Export wizard, where you choose the export destination.
Choosing where to export data.

The wizard runs the statement again when you click Finish and exports every row it returns, whatever the row limit in your options. The statement must be a single SELECT and must finish within 10 minutes.

Exporting to a file

  1. Choose the Target format: CSV, MS Excel (.xlsx), or HTML.
  2. Optionally, select Email me the exported file and enter the Recipient email address.
  3. Click Finish.
Export wizard options for a text file.
Text file export options.

Your browser downloads the file, named ExportedResults.csv, ExportedResults.xlsx, or ExportedResults.htm. If you asked for email, the file is also sent as an attachment, and the status bar says whether the email was sent. If it couldn't be sent, the status bar shows the reason, and your file is still downloaded. Email works only if your administrator has set up the email server; see Server Configuration.

Exporting as INSERT statements

This creates a script that recreates the rows in another table, for example to copy reference data into a test database.

  1. Check the Target table name. SyncriTab fills it in from the FROM clause of your statement; if it can't tell, it uses TARGET_TBL. Change it to the table the statements should insert into.
  2. Optionally, choose to email the file.
  3. Click Finish.

Your browser downloads ExportedResults.sql, with one INSERT statement per row, separated by your query terminator (go by default). To run it, open it with File › Open File (upload it first) and click Execute. See Uploading a script.

Exporting to another table

This copies the rows straight into a table in another data source, even one on a different kind of database.

  1. On the Connect to target page, choose the Data Source that will receive the data and enter your User ID and Password for it. Click Next.
  2. On the Target table page, enter the Target table name and choose:
    • New table to create it. Click Generate DDL: SyncriTab writes a CREATE TABLE statement with a column for each column of your results, using data types from the target database. Edit it if you need to, then click Create Table.
    • Existing table to add rows to a table that's already there. Click Check to compare the table with your results. SyncriTab lists any problems it finds, or says the table looks compatible.
  3. Optionally, choose to be emailed when the export finishes.
  4. Choose Run now, or Save for later (scheduler) to only save it. See Saving an export for the scheduler.
  5. Click Finish.

How columns are matched:

When rows fail

A row can fail to copy, for example because a value is too long for its column or repeats a primary key. SyncriTab skips rows that fail and copies the rest, up to a limit: Maximum errors during export in Edit › Options, 100 by default. See Options & Preferences.

Scheduled exports use the same setting, and the task's history shows how many rows were skipped.

Saving an export for the scheduler

When you enter a friendly name on the first page, the wizard also saves the export so the Task Scheduler can run it again, for example every night. See Task Scheduler.

Exporting a table from the catalog

For a quick delimited file of a whole table:

  1. In the catalog pane, right-click the table and choose Export To Text.
  2. Choose the Delimiter: comma, tab, pipe, or semicolon.
  3. Choose whether to Include header row with the column names, and whether to Quote text values.
  4. Click Export.

Your browser downloads the file, named after the table, with a .tsv extension for tab-delimited files and .csv otherwise. Every row is exported. The file is built in your browser, and the status bar counts the rows as they arrive, so a very large table can take a while. For those, the Export wizard with SELECT * FROM the table is usually faster, and can also produce Excel and HTML files.

Importing data from a text file

To load rows from a delimited text file, such as a CSV file, into a table:

  1. In the catalog pane, right-click the table and choose Import Text.
  2. Choose the Text file on your computer.
  3. Choose the Delimiter the file uses.
  4. If the first line of the file holds column names, leave First row is a header selected.
  5. Click Generate INSERTs.
The Import Text dialog for loading a text file into a table.
Importing data from a text file.

SyncriTab reads the file in your browser and puts one INSERT statement per line into the SQL editor. Nothing is added to the table yet. Review the statements, then click Execute to run them.

If something goes wrong

ProblemWhat to do
The wizard says the statement must be a single SELECT Select just one SELECT statement in the editor before choosing Query › Export.
The source query did not finish before the export timeout. The statement took longer than 10 minutes. Add a WHERE clause to export less, or make the query faster.
An export to another table stops because too many rows failed No rows were copied. Fix the problem in the error, such as a column that's too short, and run the export again. See When rows fail.
The status bar says the email could not be sent, or the email doesn't arrive Check your junk mail folder. Give your administrator the reason shown in the status bar; it's also recorded in the SyncriTab log. They can send a test email from Configuration. See Server Configuration.
The generated INSERT statements fail Check that the header names match the table's columns and that values suit the column types, for example dates in a format your database accepts.