Exporting by Query - System Emulation Tool

Teradata System Emulation Tool User Guide

Product
System Emulation Tool
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-05-07
dita:mapPath
lth1488824663584.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2492
lifecycle
previous
Product Category
Teradata Tools and Utilities

Use the command line interface to export information for a specified query. Enter the query on the command line or specify a file name containing one or more queries. To export demographics, use the switch to specify an existing QCD database. If the qcd switch is not specified when exporting execution plans, then the name qcd is used by default.

  • Use the following command syntax to export data by query:
    tset [-icf <commandfile>]|
         [[-c|-l] <DSN_or_tdpid>\<username>\<password>
          [-am <Authentication Mechanism>\<Authentication Parameter>]
          [-scs <Session characterset>]
          [-eqt <querytext>|-eqf <queryfile>]
    [-dbql <DBQL DB Name DBQL Query ID>]
          [-qcd <qcdname>]
          [-f <exportfile>]
          [-d -s -r -p -o -g -w -e -m]
          [-ux|-unx]
    [-esr]
    [-x]
    [-xapp]]

    The following examples demonstrate ways to export by query from the command line.

    Syntax Example Description
    tset -l prod\dbc\dbc -qcd myqcd -dsro -eqt "select * from orders" -f query1 Export object definitions, statistics and RAS for the objects referenced by the specified query from the system prod. Cost parameters are also exported. The execution plan for the query is exported using the QCD database named myqcd. The exported data is saved to a file named query1.
    tset -c prod -p -eqf query.txt -f queryplans Export the execution plans for all of the queries in the file query.txt from the system prod. The QCD database name qcd is used by default. The exported data is saved to a file named queryplans.
    tset -c prod\dbc -eqt "sel * from dbc.dbcinfo;" -qcd "testqcd" -p -x Export the execution plan for the specified query by capturing the plan in XML form using INSERT EXPLAIN INTO testqcd IN XML query.
    tset -c prod\dbc -dbql "DBQATXML 163822366665168764" -p Export the execution plan from DBQL Database DBQATXML with the specified Query ID.