About Teradata SQL Query Builder - Teradata Studio

Teradata Studio IDE Plug-in User Guide

Product
Teradata Studio
Release Number
15.12
Published
August 2016
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
pts1468860020550.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2043
lifecycle
previous
Product Category
Teradata Tools and Utilities

Teradata SQL Query Builder extends the Eclipse Data Tools Platform SQL Query Builder to provide execution on Teradata. SQL Query Builder provides a graphical interface to create, edit, or run SQL statements. It provides access to your database schema and objects so that you can quickly create or edit SQL statements without actually typing any SQL code. You also have the flexibility to add or modify the SQL code in the editor window.

You can open the Teradata SQL Query Builder in the SQL Editor by right-clicking an SQL file in the Project Explorer and choosing the Open With option, then selecting Teradata SQL Query Builder from the list of Editor choices.

You must have a Connection Profile assigned for the SQL file.
Some syntactic variations might exist between Teradata SQL syntax and the SQL syntax that the Eclipse DTP SQL Query Builder supports; consequently, some SQL Query Builder features might not work with Teradata SQL syntax. For example, Teradata allows for abbreviated keywords such as "sel" for "select", or "ins" for "insert", which the DTP SQL syntax does not support.
Also, if multiple SQL statements exist in the file, SQL Query Builder uses the first statement and ignores the rest. It also does not handle nested SELECT statements. The Teradata SQL Query Builder supports four types of SQL statements:
SQL Statement Type Description
SELECT Creates a SELECT statement to retrieve data from a database and displays the result set in a table format.
INSERT Creates an INSERT statement to insert rows into the table.
UPDATE Creates an UPDATE statement to update data in a table.
DELETE Creates a DELETE statement to remove data from a specified table.

The SQL Query Builder provides tabs to edit the Columns, Conditions, Groups and Group Conditions. Right-clicking the graphical area background provides options to add tables or create joins. Right-clicking a table provides options to add a table, create a join, replace a table, select all columns, deselect all columns, update an alias, and remove a table. You can also drag table objects from the Data Source Explorer and drop them in the graphical display of the SQL Query Builder to easily add tables to your SQL statement.

The SQL Query Builder can also be launched from the SQL Editor context menu by selecting a SQL statement then choosing the option Edit in SQL Query Builder. The SQL Query Builder displays the SQL statement as well as a graphical view of the tables, columns, and table joins.

If you select an existing statement to edit in the SQL Query Builder, make sure that the tables are qualified with the database name or that the designated database from the Connection Profile is the database involved in the SQL statement. Otherwise the SQL Query Builder does not recognize the columns and table joins for the graphical display. Also, if you perform a "SELECT *", the columns are not selected (checked) in the graphical view of the table. Only columns specifically named in the query are selected (checked) in the graphical view of the table.

An Outline Viewer is displayed to the right of the graphical display. This shows a high-level outline view of the SQL Statements.