Local DB Export

The Local DB Export action exports the contents of a Local Database table to a comma-separated values (CSV) file in the Staging Browser area.

For information on exporting and importing the table definition, see Exporting and Importing Local Database tables.

Image of the Local DB Export Workbench Window

Parameter descriptions

Parameter Description
Filename The name of the CSV file to write the exported data. If the file does not exist, it will be created.
If the file already exists, it will be overwritten.

The compound string feature and a substitution variable can be used in the Filename parameter to reference a variable that can be dynamically changed during runtime. For more information, see Using compound strings.

For example, entering $(filename) will result in a filename parameter in the Input tab that can reference any variable, whose contents can be changed at runtime.

Table The name of the Local Database table to export.
Where A Where clause can be used to restrict the rows included in the export.
Both constants and substitution variables can be used in the Where clause.
To construct a Where clause, use an operator (=, !=, >, >=,  <, <=, like, is null, is not null ) to relate the column to either a constant or a substitution variable.
Each of these operators can be combined with other operators using an And or Or statement.
To use a substitution variable, insert $(x) where x is a variable that will be associated to a variable on the Input tab (see the Input tab below).

Note: For columns of type TEXT, the constant or substitution variable must be enclosed in double quotes. For example:

  • C01 = "JohnDoe"
    The constant is enclosed in double quotes.
  • C01 = "$(test)"
    The substitution variable is enclosed in double quotes. The variable (test in this example) will be added to the Input tab and can then be mapped to a STRING variable (or a constant).

The where clause builder, accessed by selecting the icon , can be used to assist in building the where clause.

Maximum Rows The maximum number of rows to export.
Delimiter The character to use to separate the column values in the CSV file.
Qualifier The character to use around column values to escape reserved characters such as commas or line breaks.
The following shows example column data from a CSV file whose columns are identified by the qualifier " and each column is delimited by a comma.

Note that CRLF refers to carriage return line feed. Also note that when specifying a qualifier all values in the table column must be surrounded by quotes, not just the reserved character.
First Row is Header An option to insert a header row in the CSV file. The table's column names will be used as the column names in the CSV file.
The parameter can be set to True or False.
Delete Exported Rows An option to delete the rows from the Local Database table once they are exported.
The parameter can be set to True, False, or On Complete Success.
Compression

Compresses the exported file using the zlib compression library.

Parameters:

False - No compression applied; file is exported as plain text.

True - Zlib compression is applied to the output file. The resulting output file can be decompressed using the OpenSSL command-line utility (and the output alternatively redirected to a plain text file), e.g.

$ openssl zlib -d < My_Local_DB_Export_Filename > My_Local_DB_Export.txt

 

Output tab

Parameter Description
Successes The number of rows that were successfully exported.
Failures The number of rows that could not be exported due to a Local Database error.
This Output parameter does not return the number of rows that were not exported due to the Maximum Rows parameter being reached.
ErrorMessage An error message string if a Local Database error is encountered and the Failure route is taken.
Related topics

Exporting and Importing Local Database tables

Local DB Select