Executing an SQL Query - Visual Explain

Teradata Visual Explain User Guide

Product
Visual Explain
Release Number
15.00
Language
English (United States)
Last Update
2018-09-27
dita:id
B035-2504
lifecycle
previous
Product Category
Teradata Tools and Utilities

Executing an SQL Query

The interface that is displayed for executing SQL depends on whether Use SQL Assistant or Execute SQL Window is selected. Access this option by clicking Tools>Options. Then, from the Options dialog box, select the General tab. For more information, see “Setting General Options” on page 90.

If Teradata SQL Assistant is selected as the interface for executing SQL, Teradata SQL Assistant is started. For more information about Teradata SQL Assistant, refer to Teradata SQL Assistant for Microsoft Windows User Guide B035-2430.

Note: When connected to Teradata Database using CLIv2, the Teradata Visual Explain native interface, Execute SQL, is used.

To execute an SQL query

1 Click .

The Execute SQL window opens.

2 Do one of the following:

  • To select a query to be executed from a file, click File>Open Query.
  • To execute the query, press F5.
  • Type the query text in the Query window.
  • Select a statement in the History window.
  • 3 Click Execute.

    The results of the query appear in one or more separate Result Set windows.

    Table 25 describes all of the commands that can be used in the Execute SQL window.

     

    Table 25: Execute SQL Window Commands 

    Menu

    Command

    Task

    File

    New Query

    Clear the contents of the Query window.

    File

    Open Query

    Select a query to be executed from a file.

    File

    Execute Query

    Execute the query.

    File

    Save

    Save the contents of the active window.

    File

    Print

    Print the contents of the active window.

    File

    Close

    Close the Execute SQL window.

    Edit

    Undo

    Revert the previous operation done in the Query Text window.

    Edit

    Cut

    Remove the selected text from the Query Text window.

    Edit

    Copy

    Copy the selected contents of the active window.

    Edit

    Paste

    Paste the contents of clipboard to the Query Text window.

    Edit

    Select All

    Select everything in the active window.

    Edit

    Find

    Find a string in the active window.

    Edit

    Find Next

    Find the next occurrence of a string in the Query Text window.

    Edit

    Replace

    Perform the replace operation in the Query Text window.

    View

    Toolbar

    Toggle the toolbar of the Execute SQL window.

    View

    Status Bar

    Toggle the status bar of the Execute SQL window.

    View

    Show History

    Toggle the History window to show or hide.

    Window

    Cascade

    Cascade the child windows in the Execute SQL window.

    Window

    Tile

    Tile the child windows in the Execute SQL window.

    Window

    History

    Make the History window active.

    Window

    Query

    Make the Query window active.

    Window

    Result Set

    Make a particular Result set active.

    Help

    Help Topics

    View the Help topics.

    Help

    Using Help

    View how to use Help.

    Help

    About

    View the version and copyright information.

    Input USING Values

    When a query containing the USING clause is submitted in the execute SQL window, the Input using values screen displays. See Figure 47 on page 161.

    Figure 47: Input USING Values

    1 The Using Query display box shows the query containing the USING clause.

    2 The Using Variables display box shows the values for the Name and Datatype variables.

    3 For the Value variable, enter the data values in the Value column.

    4 Click OK or Cancel:

  • Click OK to pass the variable data to the query during execution.
  • Click Cancel to prevent passing variable data to the query.