Export by Query - System Emulation Tool

Teradata System Emulation Tool User Guide

Product
System Emulation Tool
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2492
lifecycle
previous
Product Category
Teradata Tools and Utilities

Export by Query

This export method uses DML statements to identify database objects to export. The export‑by‑query operation uses the SHOW QUALIFIED statement; therefore, use only DML statements as input. In other words, do not use Data Definition Language (DDL) statements. TSET is enhanced to support queries calling stored procedures in the 15.10 release. TSET parses the queries entered in Export by Query interface to determine if there are any queries calling stored procedures. Such queries are separated out and SHOW QUALIFIED is not submitted for those queries. Objects referred to in the Stored Procedures are retrieved by submitting SHOW PROCEDURE. For more information about the SHOW statement and restrictions, refer to SQL Data Definition Language B035-1184.

To export by query

1 From the main window, click .

The Export from Teradata Database dialog box appears.

2 Click Query.

3 In the File name box, type a file name for the exported emulation information.

Note: By default, the File Name box displays the name of the target system specified when connecting. See “Connect to a Teradata Database” on page 29.

4 Specify a path to the folder in which to save the file named in step 3 by doing one of the following:

  • In the In folder box, type a path.
  • Click Browse to locate a destination folder using Windows Explorer.
  • By default, the In Folder box displays the path specified in the Options dialog box. See “Directory Options” on page 54.

    5 Click OK.

    The Export By Query dialog box appears.

     

    Figure 4: Export by Query

    6 Define the default database for running queries by doing one of the following:

  • Type the name of the database in the Default Database box.
  • Click to select a database from the Default Database list.
  • Note: If adding a query and the database, tables, and view names in the new query are fully qualified, it is not necessary to select a database.

    7 In the QCD Name box, do one of the following:

  • Type the database name.
  • Click to select a database from the list.
  • 8 Select queries using any of the following options:

  • Type a query manually. See “Type a Query Manually” on page 64.
  • Load a query from a file. See “Load a Query from a File” on page 65.
  • Load a query from a QCD. See “Load a Query from a QCD” on page 65.
  • Load a query from DBQL. See “Load a Query from DBQL” on page 66.
  • Load a query from IPE Plans list. See “Load a Query from IPE Plans List” on page 70
  • 9 In Export Options, select the appropriate check boxes to define the exported information. See “Export Options”on page 77.

    10 [Optional] To further define the selected export options for the query, click Options.

    The Export Options dialog box appears. The options available in this dialog box depend on the selections made under Export Options on the Export By Query dialog box. See “Export Options”on page 77.

    Note: If a selected query contains a problem, clicking Options displays a Warnings dialog box. To resolve the warning, change the query or remove it from Selected Queries.

    11 [Optional] To customize the headings under Selected Queries:

    a Right‑click on the heading row.

    b Select a command from the shortcut menu.

    Figure 5: Selected Queries for Export

    12 [Optional] Click Estimate Time to view an estimate of the time needed to export each object.

    See “Estimate‑Time Rights” on page 22.and “Estimate Export Time” on page 90.

    13 Click Export to begin the export process.

    Note: The export‑by‑query operation uses the SHOW QUALIFIED statement. To avoid errors, only input DML statements, not DDL statements. If there is an error, a Warning dialog box appears. Modify the statement before restarting the export operation. After the export operation completes, a summary report of the export operation results appears. See “View a Summary Report” on page 134. Queries which call stored procedures are separated out before submitting SHOW QUALIFIED. The separated queries (calling Stored Procedures) are parsed to get the Stored Procedure object and SHOW PROCEDURE is submitted to retrieve the Stored Procedure Object Definition. Nested Stored Procedures are also captured.