Using Query Builder - Teradata SQL Assistant

Teradata® SQL Assistant for Windows User Guide

Product
Teradata SQL Assistant
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2020-01-03
dita:mapPath
gfk1537201040714.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2430
Product Category
Teradata Tools and Utilities
The state of the Query Builder window (its size, and the list you are viewing) is saved so that future uses of the Query Builder window start in the same state that it was last used in.
  1. Do one of the following:
    • Select Help > Query Builder.
    • Press F2.
    • Right-click in the Query window and select Query Builder.
  2. From the drop-down list, select a statement type.
    See the Query Builder Statements table below for a description of the statement types.
  3. Do one of the following to move the statement to the Query window:
    • Double-click the statement in the left pane.
    • Right-click the statement for the following options:
      • Insert into query – Inserts the statement the Query window
      • Replace query – Replaces the statement in the Query window
      • Copy to clipboard – Copies the statement to the Clipboard
    • Drag and drop the statement into the Query window (insert it where you like).
  4. Build statements as desired.

    To learn more about building custom SQL Sets, see also Creating Custom SQL Sets.



    Query Builder Statements
    Option Description
    SQL Statements

    When you select the SQL Statements option, the statement list in the left pane shows each of the statement types available on the current data source. When you select a statement in the list, an example of that statement appears in the area to the right.

    If you are not connected to any server, syntax is based on the server you were most recently connected to. If you are not connected to any server during the current Teradata SQL Assistant session, you receive the default Teradata syntax.

    You can customize the statement list or the examples using the tool buttons to the right of this drop-down list.

    When connected to a database, you can display the full syntax for the selected statement by doing one of the following:
    • Pressing F5
    • Right-clicking the Statement list item and selecting Show Syntax.
    Procedure Builder

    Select a stored procedure statement from the list in the left pane to display an example of its syntax in the right pane.

    When you select the Procedure Builder option, the left pane shows a list of statements that are valid only when used in a CREATE or REPLACE procedure statement.

    <User Defined>

    Additional user (or DBA) defined entries can appear after the above items. Each SQL Set must be given a name that appears in the dropdown list. When selected, the SQL Examples, snippits, or queries contained in that SQL Set appear in a list. Each SQL Set is saved as a *.qbs file. This allows a DBA or user to create SQL Sets and easily distribute them to other users.

    For additional information, see Creating Custom SQL Sets.