Using Query Builder - SQL Assistant

Teradata SQL Assistant for Microsoft Windows User Guide

SQL Assistant
Release Number
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

Using Query Builder

Using Query Builder is an easy and convenient to build SQL statements in the Query window.

1 Open Query Builder by doing one of the following:

  • Press F2.
  • Select Help > Query Builder.
  • Right-click in the Query Window and select Query Builder from the shortcut menu.
  • 2 From the drop-down list, select a statement type.

    See “Table 14: Query Builder Statements” on page 93 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” on page 94.


    Table 14: Query Builder Statements 



    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 dropdown 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 from the popup menu
  • 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 the List below. 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 also “Creating Custom SQL Sets” on page 94.

    Note: The state of the Query Builder window (its size, and which 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.