FAQs on Query Development | Teradata Studio/Studio Express - Query Development FAQ - Teradata Studio

Teradata® Studio™ Express User Guide - 17.20

Product
Teradata Studio
Release Number
17.20
Published
September 2022
Language
English (United States)
Last Update
2022-09-23
dita:mapPath
ztp1648839236373.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2042
Product Category
Teradata Tools and Utilities

How to execute queries in Teradata Studio/Studio Express?

To enter SQL statements and execute queries in Teradata Studio/Studio Express:
  1. Perform any of the following to open the Teradata SQL Editor:
    • Select the connection profile in the Data Source Explorer and click "" .
    • Go to File > New SQL Editor and select a connection profile from the drop-down in the SQL Editor.
  2. Enter SQL statements in the editor.
  3. Perform any of the following to execute the statements.
    • Click "" for the single statement.
    • Click "" for multiple statements.
    • Right-click the SQL Editor and select Execute for a single statement.
    • Right-click the SQL Editor and select Execute All for multiple statements.
    • Use the Ctrl+ALT+X key.

Does the Teradata Studio/Studio Express check the syntax of the SQL statements in the SQL Editor?

Yes, the Teradata Studio/Studio Express parses the SQL statements you enter in the SQL Editor and underlines syntax errors in red. Hovering on the underlined word opens a list of expected words. You can ignore the errors and still execute the SQL statement.

The Teradata Studio/Studio Express uses the grammar for the version of the database you have selected in the Connection Profile drop-down list in the SQL Editor to validate the statements.

How to clear queries from the SQL Editor?

Click "" from the SQL Editor toolbar to clear all the queries.

How to display line numbers in the SQL Editor?

Right-click the left margin of the SQL Editor and select Show Line Numbers.

How to execute only selected lines from the SQL Editor?

Right-click the text from the SQL Editor and select Execute Selected Text.

How to add an SQL template to the SQL Editor?

To add an SQL template:
  1. Go to the beginning of the line.
  2. Use the Ctrl+Space key. A dialog box appears with the list of SQL templates.
  3. Select a template to add to the SQL statement.

Can you use named parameters in queries?

Yes, you can use the named parameter in queries.

For example, you can execute the query SELECT * FROM db.customer WHERE region = ?\region;, and enter the value for the region parameter in the Configure parameter dialog box.

How to provide audible notification on queries?

To provide audible notifications on queries:
  1. Go to Windows > Preferences > Teradata Datatools > SQL Handling.
  2. Select the Sound tab.
  3. Set the success sound and failure sound to System Beep or Select Sound.
    For Select Sound, you need to browse the sound files from the system and select.

How to change the font of the queries?

To change the font of the queries:
  1. Go to Windows > Preferences > General > Appearances > Colors and Fonts.
  2. Expand Basic and select:
    • Text Font: To edit the SQL Editor font.
    • Dialog Font: To edit the Teradata Result Set Viewer font.
  3. Click Edit and edit the font as required.
  4. Click OK to save the changes.
  5. Click Apply.
    To restore the font click Restore Defaults on the Colors and Fonts window.

Where to change the formatting of the SQL queries?

Go to Windows > Preferences > Teradata Datatools > SQL Formatter and change formatting options.

Where to change the syntax coloring of the SQL queries?

Go to Windows > Preferences > Data Management > SQL Development > SQL Editor > Syntax Coloring and change colors of the syntax objects.

How to open the Outline view for SQL Editor?

To open the Outline view:
  1. Go to Windows > Show View and click Outline. The Outline view appears at the bottom of the screen.
  2. Click and drag the Outline view up to the right-hand side of the SQL Editor.
  3. Select SELECT Statements from the Outline view. The corresponding SQL statement is highlighted in the SQL Editor window.

How to switch to rectangular selection on the SQL Editor?

Click the SQL Editor and use the SHIFT+ALT+A key to switch to the rectangular selection (Column mode selection). Again, use the SHIFT+ALT+A key to return to normal mode selection.

How to open an existing SQL file in the SQL Editor?

You can import, or drag an existing SQL file to Project Explorer.
  • To import an SQL file:
    1. Go to Files and click Import to open the Import dialog box:
    2. Select General > File System.
    3. Click Next.
    4. Browse for the SQL file directory in your system.
    5. Select the required SQL files from the right pane.
    6. Browse your Teradata Studio/Studio Express workspace to locate a project folder where to import the SQL files.
    7. Click Finish. The imported SQL files appear in Project Explorer.
    8. Right-click a SQL file and select Open With > Teradata SQL Editor. The SQL file opens in the SQL Editor.
  • To drag an existing SQL file:
    1. Open the SQL file directory in your system.
    2. Drag the files into the Project Explorer. The File Operation dialog box opens.
    3. Click Copy Files. The SQL files appear in Project Explorer.
    4. Right-click a SQL file and select Open With > Teradata SQL Editor. The SQL file opens in the SQL Editor.

How to compare SQL files?

To compare SQL files:
  1. Go to the Project Explorer view.
  2. Select multiple SQL files using the Ctrl key.
  3. Right-click and select Compare With > Each Other.

The SQL files open in the Compare Editor, showing a side-by-side comparison with toolbar buttons to run through the differences.

How to save SQL query to an external SQL file?

To save the SQL query to an external SQL file:
  1. Click the drop-down arrow beside the "" in the SQL Editor toolbar.
  2. Select Export to File System. The Save File dialog box opens.
  3. Define a directory from your system.
  4. Click Save.

How to save result set data to a file?

There are two options for saving the result set data. You can save the result set data to the file system (Export), or a file stored in the workspace (Save).

Click "" or "" from the Result Set Viewer toolbar and select the name of the file to save the result set data.

How to export result set data to a file automatically?

Refer Setting SQL Handling Preferences for detailed information.