SQL History Form - Teradata Studio

Teradata Studio Express User Guide

Product
Teradata Studio
Release Number
16.00
Published
March 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
cxo1484765174902.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2042
lifecycle
previous
Product Category
Teradata Tools and Utilities

The SQL History form provides an enhanced display of the history information. As you execute SQL statements from the SQL Editor or run functions from the Data Source Explorer, an entry is added to the SQL History list.

The history displays extensive information about each SQL execution. It includes execution elapsed time, DBMS time, fetch time, database server, row count, parameter display for macros and stored procedures, SQL statement, and SQL statement type.

The SQL History form displays the data in a grid format that lets you select rows or cells. It provides options to copy cells or rows, sort columns, delete rows, edit the note or SQL for a history entry, filter columns, search for result history data, format the display, and re-execute SQL statements.

The SQL History uses an embedded Derby Database to manage the SQL History entries.

If you close the form and need to re-open it, go to Window > Show View > Other > SQL History.

You can add notes manually by clicking on the Note column value. You can also choose to be prompted to add notes when you execute the SQL. Set the Prompt for notes option using the SQL Handling preferences.

You can sort columns in ascending and descending order with the exception of the Parameters column. For single column sorting, left-click the mouse button. For multi-column sorts, note the following:
  • Columns are movable and re-sizable. Many of the columns are grouped together under a collapsible header.
  • Rows can be selected by clicking in the numbered row header.
  • Column order, collapsed columns, filter, sort, and formatting are preserved from session to session.
  • If a filter is in effect, the result of a newly executed SQL statement is inserted as the top row, regardless of whether it meets the filter criterion. If a sort is in effect the new entry is inserted in the sorted order.
  • The Result column contains a summary of the executed SQL operation. To read the entire contents in a column cell, hover the mouse pointer over the cell. Error results show as red text in the resulting tool tip display. The following examples are samples of the Result summary.
  • Example 1: In this example a single statement was executed successfully. Executed as Single statement. >Elapsed time = 00:00:00.108 STATEMENT 1: Select Statement completed. 26 rows returned.
  • Example 2: In this example the executed statement failed. This statement also has this icon associated with it. Executed as Single statement. Failed [3807 : 42S02] Object 'bogus' does not exist. Elapsed time = 00:00:00.145 STATEMENT 1: Select Statement failed.
  • Example 3: In this example the executed statement was canceled. This statement also has this icon associated with it. Executed as Single statement. Canceled. Elapsed time = 00:00:00.000 STATEMENT 1: Select Statement canceled.

Toolbar Actions

Icon Option Description
Delete Selected Rows Deletes selected row(s) from the view and history database.
Filter history display Opens a dialog to filter the display.
Export history Opens a dialog to export history view items to XML file.
Import history Opens a dialog to import history items from either a previously exported XML history file or SQL Assistant history file.
Cleanup history Opens a dialog to clean up SQL history records based on selected criteria.
Format History View Enables you to format the display. The platform-specific Font dialog allows you to select the font, size, and color (on most platforms).
Sort history display Opens a dialog for setting a multi-column sort.

Toolbar Menu Options

Icon Option Description
Delete Selected Rows Deletes selected row(s) from the view and history database.
Export history Opens a dialog to export history view items to an XML file.
Import history Opens a dialog to Import history items from either a previously exported XML history file or SQL Assistant history file.
Cleanup history Opens a dialog to clean up SQL history records based on selected criteria.
Clear Filter Removes the current filter from the display.
Filter Opens a dialog to filter the display.
Format History View Enables you to format the display. The platform specific Font dialog displays to allow you to select font, size, and color (on most platforms).
Sort multiple columns Opens a dialog for setting a multi-column sort.

Context Menu Options:

Icons Option Description
Find Allows you to search the SQL History view for a value.
Find Next Finds the next matching value in the history view.
  Copy Row Copies the selected row(s). Rows are copied as text and as HTML. The HTML display preserves the column headers. The target to which you paste determines whether text or HTML displays.
Copy Cells Copies the cell data to the clipboard.
Delete Row Deletes selected row(s) from the view and history database.
  Edit SQL Edits the SQL from a selected cell in the SQL Statement column in an SQL Editor.
  Edit Note Edits the note from a selected cell in the Note column.
  Reexecute statement Re-executes the SQL from the selected cell in the SQL Statement column.