EXPORT
Exports a domain to a table or a file. The syntax is:
Syntax
EXPORT [Export target] [Target name] [Query resolution table]
[Query columns] [Filter]
Parameters
Export target and Target name
Defines the object to where the data is exported. The export target can be:
*Analytical database and table
Defines new or existing database and table names.
*CSV file (with the following delimiters available: coma, colon, semicolon, at, sharp, quote, plus, minus, apos, tilde)
Defines a CSV file name. Columns are delimited by the pipe (|) character. The file is stored in:
C:\Program Files\BIRTAnalytics\data\FastDB
*Fixed‑length file
Defines a file name. The columns have fixed length and the file is saved in:
C:\Program Files\BIRTAnalytics\data\FastDB
Query resolution table
Defines the table you are exporting data from.
Query columns
Defines the query columns. Each column must be defined on a separate line, using the full name in the following format:
[Database].[Table].[Column]
To export the whole table, do not define columns.
Filter
Defines a domain you are using to filter the data. Filter is a required parameter.
How to export to a database
You have to choose the database where you want the new table to be created, the name of the new table, and the columns to be created in the destination table.
1 In Main file, choose New. The list of transformation instructions appears.
2 In the list of instructions, choose Export. Export appears, as shown in Figure 5‑48.
Figure 5‑48 Exporting data to a table
3 In Export target, select Table.
4 In Export target, type a new database name, or select an existing database name from the drop-down list.
5 In Export target, type a new table name, or select an existing table name from the drop‑down list.
6 In Resolution table, select the table from which you want to export data.
7 In Enter columns, type the name of the columns, using the required format. Leave it empty if you wish to export the whole table. You can double-click in the box to open a text editor and type the column list.
8 Choose Click to edit the domain to define a domain that would filter the data. Defining a domain is required.
9 In Description, type a short description of the instruction’s purpose.
10 In Export, choose OK to define the Export instruction.
11 Save the project.
12 Run the Export instruction.
13 To validate the export, open Explorer. Refresh the database. The new table appears, as shown in Figure 5‑49.
Figure 5‑49 Validating an Export instruction
How to export data to a text file
1 In Main file, choose New. The list of transformation instructions appears.
2 In the list of transformation instructions, choose Export. Export appears, as shown in Figure 5‑50.
Figure 5‑50 Exporting data to a CSV file
3 In Export target, select CSV file.
4 In Export target, type the name of the CSV file.
5 In Resolution table, select the table from which you want to export data.
6 In Enter columns, type the name of the columns, using the required format. Leave it empty if you wish to export the whole table.
7 Choose Click to edit the domain to define a domain that would filter the data. Defining a domain is required.
8 In Description, type a short description of the instruction’s purpose.
9 In Export, choose OK to define the Export instruction.
10 Save the project.
11 Run the Export instruction. The exported file is saved on the machine where BIRT Loader is installed. The file is located in:
C:\Program Files\BIRTAnalytics\data\FastDB
The file format uses a pipe (|) as a column character delimiter, and CRLF as the end‑of‑line character, as shown in Listing 5‑1.
Listing 5‑1 Exported CSV file
114|Melbourne|Victoria|Australia
119|Nantes||France
124|San Rafael|CA|USA
131|NYC|NY|USA
141|Madrid||Spain
146|Lyon||France
How to export to a fixed‑length file
1 In Main File, choose New. The list of transformation instructions appears.
2 In the list of transformation instructions, choose Export. Export appears, as shown in Figure 5‑51.
Figure 5‑51 Exporting data to a fixed‑length file
3 In Export target, select Fixed length file.
4 In Export, type the name of the fixed‑length file.
5 In Resolution table, select the table from which you want to export data.
6 In Enter columns, type the name of the columns, using the required format. Leave it empty if you wish to export the whole table.
7 Choose Click to edit the domain to define a domain that would filter the data. Defining a domain is required.
8 In Description, type a short description of the instruction’s purpose.
9 In Export, choose OK to define the Export instruction.
10 Save the project.
11 Run the Export instruction. The exported file is saved on the machine where BIRT Loader is installed. The file is located in:
C:\Program Files\BIRTAnalytics\data\FastDB
The file format uses fixed length for saving the data column, as shown in Listing 5‑2.
Listing 5‑2 Fixed‑length file
Melbourne Victoria Australia
Nantes France
San Rafael CA USA
NYC NY USA
Madrid Spain
Lyon France