Teradata SQL Assistant for Microsoft Windows. User Guide

Size: px
Start display at page:

Download "Teradata SQL Assistant for Microsoft Windows. User Guide"

Transcription

1 Teradata SQL Assistant for Microsoft Windows User Guide Release B K March 2015

2 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active Data Warehousing, Active Enterprise Intelligence, Applications-Within, Aprimo Marketing Studio, Aster, BYNET, Claraview, DecisionCast, Gridscale, MyCommerce, QueryGrid, SQL-MapReduce, Teradata Decision Experts, "Teradata Labs" logo, Teradata ServiceConnect, Teradata Source Experts, WebAnalyst, and Xkoto are trademarks or registered trademarks of Teradata Corporation or its affiliates in the United States and other countries. Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc. AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc. Apache, Apache Hadoop, Hadoop, and the yellow elephant logo are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Apple, Mac, and OS X all are registered trademarks of Apple Inc. Axeda is a registered trademark of Axeda Corporation. Axeda Agents, Axeda Applications, Axeda Policy Manager, Axeda Enterprise, Axeda Access, Axeda Software Management, Axeda Service, Axeda ServiceLink, and Firewall-Friendly are trademarks and Maximum Results and Maximum Support are servicemarks of Axeda Corporation. Data Domain, EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation. GoldenGate is a trademark of Oracle. Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company. Hortonworks, the Hortonworks logo and other Hortonworks trademarks are trademarks of Hortonworks Inc. in the United States and other countries. Intel, Pentium, and XEON are registered trademarks of Intel Corporation. IBM, CICS, RACF, Tivoli, and z/os are registered trademarks of International Business Machines Corporation. Linux is a registered trademark of Linus Torvalds. LSI is a registered trademark of LSI Corporation. Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States and other countries. NetVault is a trademark or registered trademark of Dell Inc. in the United States and/or other countries. Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries. Oracle, Java, and Solaris are registered trademarks of Oracle and/or its affiliates. QLogic and SANbox are trademarks or registered trademarks of QLogic Corporation. Quantum and the Quantum logo are trademarks of Quantum Corporation, registered in the U.S.A. and other countries. Red Hat is a trademark of Red Hat, Inc., registered in the U.S. and other countries. Used under license. SAP is the trademark or registered trademark of SAP AG in Germany and in several other countries. SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc. SPARC is a registered trademark of SPARC International, Inc. Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and other countries. Unicode is a registered trademark of Unicode, Inc. in the United States and other countries. UNIX is a registered trademark of The Open Group in the United States and other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN "AS-IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. The information contained in this document may contain references or cross-references to features, functions, products, or services that are not announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features, functions, products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions, products, or services available in your country. Information contained in this document may contain technical inaccuracies or typographical errors. Information may be changed or updated without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any time without notice. To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document. Please teradata-books@lists.teradata.com. Any comments or materials (collectively referred to as "Feedback") sent to Teradata Corporation will be deemed non-confidential. Teradata Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform, create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis. Further, Teradata Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including developing, manufacturing, or marketing products or services incorporating Feedback. Copyright by Teradata. All Rights Reserved.

3 Preface Purpose This book provides information about Teradata SQL Assistant for Microsoft Windows which is a Teradata Tools and Utilities product. Teradata Tools and Utilities is a group of products designed to work with the Teradata Database or other database. Teradata SQL Assistant is a Windows-based information discovery tool designed to retrieve, manipulate, and store data from ODBC-compliant database servers. Audience This book is intended for use by: SQL proficient users who know how to formulate queries for processing on the Teradata Database or other ODBC-compliant systems Relational Database developers Supported Releases This book supports the following releases: Teradata Database Teradata Tools and Utilities Teradata SQL Assistant Note: See To display information about SQL Assistant on page 38 to verify the Teradata SQL Assistant version number. To locate detailed supported release information: 1 Go to 2 Under Online Publications, click General Search. 3 Type 3119 in the Publication Product ID box. 4 Under Sort By, select Date. 5 Click Search. 6 Open the version of the Teradata Tools and Utilities ##.# Supported Platforms and Product Versions spreadsheet associated with this release. Teradata SQL Assistant for Microsoft Windows User Guide, Release

4 Preface Prerequisites The spreadsheet includes supported Teradata Database versions, platforms, and product release numbers. Prerequisites The following prerequisite knowledge is required for this product: Teradata SQL, or the SQL of another ODBC compliant database Relational Database Management Systems Microsoft Windows operating system ODBC connectivity software In addition, the following might be helpful to review prior to using Teradata SQL Assistant: This document... Windows Help file contains this information... Online help, accessible from the Teradata SQL Assistant main window by clicking on the toolbar. Changes to this Book The following changes were made to this book in support of the current release. Changes are marked with change bars. For a complete list of changes to the product, see the Teradata Tools and Utilities Release Definition associated with this release. Table i: Changes to this Book Date March Description Chapter 2 > Added topic and button for Replay Macro. Appendix B > The Query Toolbar > Figure 3: Updated Query toolbar image. Chapter 2 > Table 12: Added two new options: Limit parsing for Queries larger than, and Disable parsing for Queries larger than. Standardized button icons throughout document. Additional Information Additional information that supports this product and Teradata Tools and Utilities is available at the web sites listed in the table that follows. 4 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

5 Preface Additional Information Table ii: Additional Product Information Type of Information Description Source Release Overview Late Information Additional product information CD-ROM images Ordering information for manuals Use the Release Definition for the following information: Overview of all of the products in the release Information received too late to be included in the manuals Operating systems and Teradata Database versions that are certified to work with each product Version numbers of each product and the documentation for each product Information about available training and the support center Use the Teradata Information Products web site to view or download specific manuals that supply related or additional information to this manual. Access a link to a downloadable CD-ROM image of all customer documentation for this release. Customers are authorized to create CD-ROMs for their use from this image. Use the Teradata Information Products web site to order printed versions of manuals. 1 Go to 2 Under Downloadable Publications, click General Search 3 Type 2430 in the Publication Product ID box. 4 Click Search. 5 Select the appropriate Release Definition from the search results. 1 Go to 2 Under the Downloadable Publications subcategory, Browse by Category, click Data Warehousing. 3 Do one of the following: For a list of Teradata Tools and Utilities documents, click Teradata Tools and Utilities, then select an item under Releases or Products. Select a link to any of the data warehousing publications categories listed. Specific books related to Teradata SQL Assistant for Microsoft Windows User Guide are as follows: ODBC Driver for Teradata User Guide B Teradata Query Scheduler User Guide B Teradata Visual Explain User Guide B Go to 2 Under the Online Publications subcategory, Browse by Category, click Data Warehousing. 3 Click CD-ROM Images. 4 Follow the ordering instructions. 1 Go to 2 Under the Downloadable Publications subcategory, Browse by Category, click Data Warehousing. 3 Click Documentation CD Images Teradata Database and Teradata Tools & Utilities. Teradata SQL Assistant for Microsoft Windows User Guide, Release

6 Preface Product Safety Information Table ii: Additional Product Information (continued) Type of Information Description Source General information about Teradata The Teradata home page provides links to numerous sources of information about Teradata. Links include: Executive reports, case studies of customer experiences with Teradata, and thought leadership Technical information, solutions, and expert advice Press releases, mentions and media resources 1 Go to Teradata.com. 2 Select a link. Product Safety Information This document may contain information addressing product safety practices related to data or property damage, identified by the word Notice. A notice indicates a situation which, if not avoided, could result in damage to property, such as equipment or data, but not related to personal injury. Example: Notice: Improper use of the Reconfiguration utility can result in data loss. 6 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

7 Table of Contents Preface Purpose Audience Supported Releases Prerequisites Changes to this Book Additional Information Product Safety Information Chapter 1: Getting Started Introduction What is Teradata SQL Assistant? How Teradata SQL Assistant Works Teradata SQL Assistant Features Defining a Data Source Defining an ODBC Data Source Defining a.net Data Provider for Teradata Data Source Defining a.net Data Provider for Oracle Data Source Starting Teradata SQL Assistant Connecting to and Disconnecting from a Data Source Connecting to an ODBC Data Source Connecting to.net for Teradata Connecting to.net for Oracle Connecting to Multiple Data Sources Re-Connecting to a Data Source Displaying a Color Bar in the Query Window Changing the Database Password Main Window Menu Bar Hiding Toolbars Using the Status Bar Tabbing Windows Teradata SQL Assistant for Microsoft Windows User Guide, Release

8 Table of Contents Cascading Windows Tiling Windows Arranging Windows Changing the text size in a child window Using Online Help Using Shortcut Menus and Commands Database Explorer Tree Viewing Object Types Opening and Closing the Database Explorer Tree Navigating to the Database Explorer Tree Changing the Width of the Tree Area Moving the Explorer Tree Window Dragging Object Names to the Query Pane Dragging Multiple Objects Using Quick Paste Adding Double Quotes around Object Name Adding Object Types Displaying Object Definitions Displaying Data Source Information Generating SQL for use with an Object Editing Table Data Working with the Edit Table Dialog Box Adding Databases Removing Databases Refreshing the Database Explorer Tree Displaying the Shortcut Menu Setting Database Tree Preferences Favorites and Examples Pane Opening and Closing the Favorites Pane Navigating to the Favorites Pane Changing the Width of the Favorites Pane Moving the Favorites Pane Window Listing All Tables or Views In a Database Listing All Columns In a Table or View Setting General Program Preferences Setting Default File Paths Using Page Setup Using Print Preview Support for Unicode and UTF Displaying Unicode Data Exporting Unicode Data Importing Unicode Data Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

9 Table of Contents Support for the Visually Impaired Text Size Color scheme Audible support Limitations General Teradata Limitations Teradata.NET Specific Limitations Oracle.NET Specific Limitations ODBC Specific Limitations Chapter 2: The Query Window Introduction to the Query Window Using the Query Window Using SQL, DDL, and DML Statements Displaying the Query Window Toolbar Allowing Multiple Queries Splitting the Query Window into Two Windows Selecting Text and Inserting Bookmarks Using the Query Window Margin Creating Statements (Single and Multi) Parameterized Queries Magnifying the Query Window Setting Query Options Setting Code Editor Options Entering and Executing Queries Entering a Query Using Conditional Logic in a Query Outlining Using Code Completion Displaying Function Descriptions Inserting Function Templates Customizing Code Completion Lists Executing a Query Using Transactions Running Multiple Queries Executing Multiple Statements in Parallel Submitting Part of a Query Aborting a Query in Progress Executing a Query Saved To a File Automatically Minimizing the Teradata SQL Assistant Window Teradata SQL Assistant for Microsoft Windows User Guide, Release

10 Table of Contents Renaming a Query Tab Deleting a Query Tab Working With SQL Text in the Query Window Copying SQL from Previous History Record to the Query Window Copying SQL from Next History Record to the Query Window Preventing Queries from Being Saved in the History Window Undoing or Redoing Query Window Changes Setting Repeat Count Recording and Executing Query Window Macros Saving a Query Performing a Quick Save Adding a Query to Favorites Opening a Query from a File Copying a Query to Notepad Printing a Query Adding Comments to Queries Highlighting a block of Text Showing Whitespace Converting Tabs to Spaces Indenting Lines in a Query Using the Right-to-Left Editor for Queries Deleting Blank Lines from a Query Finding a Text String in the Query Window Replacing a Text String in the Query Window Displaying an Explain Plan of a Query Displaying a Visual EXPLAIN Plan Displaying a Textual EXPLAIN Plan Query Builder Overview SQL Statements Procedure Builder <User Defined> Using Query Builder Supported Databases for Query Builder Creating Custom SQL Sets Scheduling Queries for Later Execution Before Scheduling Queries Scheduling Queries Formatting a Query Indentation Language Definition Files Importing Data Before You Begin Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

11 Table of Contents Importing Data from a File Exiting from Import Mode Types of Import Operations Import Rules Defining the Null Value for an Import Operation Generating Multiple Reports From a Single Query Using the Query Window Shortcut Menu Displaying the Shortcut Menu Functions in the Query Window Chapter 3: The Answerset Window Introduction to the Answerset Window Using the Answerset Window Viewing Your Results Adjusting Row Height Adjusting Column Width Re-arranging Column Order Keeping Selected Columns From Scrolling Out of View Viewing Long Strings of Text Within Cells Closing Answerset Windows Before Submitting a New Query Selecting All Answerset Rows Merging Cells in the Answerset Displaying the SQL That Generated an Answerset Hiding Columns/Showing All Columns Closing All Answersets Hiding Column Headers Hiding Row Headers Displaying Totals for Numeric Columns Displaying Aggregate Values Finding a Text String in the Results Grid Naming an Answerset Window Naming an Answerset Tab Deleting an Answerset Tab Opening a Saved Answerset Saving an Answerset to a File Saving as XML Copying an Answerset to Notepad Printing an Answerset Using Print Preview Teradata SQL Assistant for Microsoft Windows User Guide, Release

12 Table of Contents Cancelling Print Jobs Sorting an Answerset Filtering the Answerset Grouping the Answerset Setting Answerset Options Setting Data Format Options Changing the Font for the Entire Window Zooming the Answerset Window Charting Answerset data Working with Charts Formatting an Answerset Formatting a Block of Cells Formatting a Single Cell Formatting a Single Row or Column Formatting Multiple Rows or Columns Formatting the Entire Spreadsheet Displaying Commas to Mark Thousand Separators Displaying Numbers in Scientific Notation Displaying Decimal Places Exporting a Resultset Exporting Results Single-Clicking to Display the Export File Saving Multiple Answersets Exporting to Access Formats and Data Types Setting Export/Import Options Setting Export Options Setting Import Options Understanding Large Object Support Using Answerset Shortcut Menus Displaying the Shortcut Menu Chapter 4: The History Window Introduction to the History Window The Columns of the History Window Using the History Window Opening the History Window Closing the History Window Viewing the Result Message Viewing DBS Error Messages Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

13 Table of Contents Viewing the History Rows Rearranging History Columns Filtering the History Rows Copying SQL from Previous History Record to the Query Window Copying SQL from Next History Record to the Query Window Selecting All History Rows Sorting the History Records Finding a Text String in the History Table Cleaning up the History Table Magnifying the History Window Setting History Window Options Editing History Records Displaying and Navigating the Edit History Dialog Box Editing a History Record Compacting History Adding or Change a Note in a History Record Saving, Copying, and Printing History Saving History Rows Copying Rows to the Clipboard Copying Rows to Notepad Printing the Contents of the History Window Cancelling Print Jobs Storing History Files Changing the Location of History Files The History Window Shortcut Menu Displaying the Shortcut Menu Appendix A: Startup Parameters and Default Preferences Startup Parameters Default Preferences (Options) Miscellaneous and General Default Preference Settings Query Default Preference Settings Code Editor Tab Default Preference Settings Data Format Tab Default Preference Settings Answerset Tab Default Preference Settings Export/Import Tab Default Preference Settings History Tab Default Preferences and Descriptions Database Tree Default Preferences and Descriptions File Paths Tab Default Preference Settings Teradata SQL Assistant for Microsoft Windows User Guide, Release

14 Table of Contents Page Setup Default Preferences and Settings Appendix B: Menus, Toolbars and Shortcuts Using Toolbars and Buttons The Main Toolbar The Answerset Toolbar The Query Toolbar Toolbar Button Descriptions Customizing Menus and Toolbars Adding a Command to a Menu or Toolbar Menu Commands Only Removing a Command from a Menu or Toolbar Moving a Command Adding or Removing a Break Between Commands Changing the Name for a Command Assigning or Changing a Keyboard Shortcut Changing Menu Behavior Showing Recently Used Commands First Resetting the Default Menu Bar Hiding the Toolbars Showing or Hiding Toolbar Screen Tips Adding, Removing, Renaming, or Resetting a Toolbar General Command Shortcut Keys Query Specific Shortcut Keys Window Control Shortcut Keys Answer/History Specific Shortcut Keys Appendix C: Configuration Files UserOptions.config Toolbars.config DataSources.config DockMgr.config Vendors.config Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

15 Table of Contents Glossary Index Teradata SQL Assistant for Microsoft Windows User Guide, Release

16 Table of Contents 16 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

17 List of Figures Figure 1: The Default Main Toolbar Figure 2: The Default Answerset Toolbar Figure 3: The Default Query Toolbar Teradata SQL Assistant for Microsoft Windows User Guide, Release

18 List of Figures 18 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

19 List of Tables Table 1: ODBC Data Source Types Table 2: ODBC Driver Setup for Teradata Database Dialog Box: Field Descriptions Table 3: Description of the Teradata.NET Connection Dialog Box Table 4: Description of the Oracle.NET Connection Dialog Box Table 5: Sub Folders Created When Objects Are Added Table 6: Generate SQL Sub Menus Table 7: Explorer Tree Shortcut Menu Commands Table 8: Options Dialog Box, DB Tree Tab Table 9: Options Dialog Box, General Tab Table 10: Description of the File Paths Options Table 11: Description of the Page Setup Dialog Box and Print Preview Window Table 12: The Query Tab in the Options Dialog Box Table 13: Code Editor Tab in the Options Dialog Box Table 14: Query Builder Statements Table 15: Query Builder Icon Descriptions and Right-Click Options Table 16: The Query Window Shortcut Menu Commands and Descriptions Table 17: Clipboard Support Edit Commands Table 18: Find Dialog Box Table 19: Answerset File Format Types Table 20: Answerset Tab in the Options Dialog Box Table 21: Data Format Tab in the Options Dialog Box Table 22: Chart Definition Dialog Box Table 23: Chart Menus and Shortcut Keys Table 24: How SQL Assistant Maps Teradata Data Types to Access Data Types Table 25: Import/Export Tab in the Options Dialog Box Table 26: Export Tab in the Options Dialog Box Table 27: Import Tab in the Options Dialog Box Table 28: The Answerset Window Shortcut Menu Commands and Descriptions Table 29: The History Window Column Descriptions Table 30: Description of History Window Filter Options Table 31: Find Dialog Box Table 32: Description of Cleanup History Options Teradata SQL Assistant for Microsoft Windows User Guide, Release

20 List of Tables Table 33: History Tab in the Options Dialog Box Table 34: History File Format Types Table 35: The History Window Shortcut Menu Commands and Descriptions Table 36: Startup Parameters Table 37: Miscellaneous and General Default Preferences and Descriptions Table 38: Query Default Preferences and Descriptions Table 39: Code Editor Tab Default Preferences and Descriptions Table 40: Data Format Tab Default Preferences and Descriptions Table 41: Answerset Tab Default Preferences and Descriptions Table 42: Export/Import Tab Default Preferences and Descriptions Table 43: History Tab Default Preferences and Descriptions Table 44: Database Tree Default Preferences and Descriptions Table 45: File Paths Tab Default Preferences Table 46: Page Setup Defaults and Descriptions Table 47: Toolbar Button Descriptions Table 48: Adding, Deleting, Renaming and Resetting a Toolbar Table 49: Shortcut Keys Table 50: Query Specific Shortcut Keys Table 51: Window Control Shortcut Keys Table 52: Answer / History specific Shortcut Keys Table 53: Properties Described by the Vendors.config File Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

21 CHAPTER 1 Getting Started The topics in this chapter provide the basic information required to get started using Teradata SQL Assistant: Introduction Defining a Data Source Starting Teradata SQL Assistant Connecting to and Disconnecting from a Data Source Main Window Database Explorer Tree Favorites and Examples Pane Listing All Tables or Views In a Database Listing All Columns In a Table or View Setting General Program Preferences Support for Unicode and UTF-8 Support for the Visually Impaired Limitations Note: This document uses the term database as the term for table qualifier (the object that contains data tables). This term varies depending on the database vendor, and might be referred to as owner, schema or catalog in the vendor s own documentation. Introduction This topic provides basic information about Teradata SQL Assistant and a brief overview of its features. What is Teradata SQL Assistant? How Teradata SQL Assistant Works Teradata SQL Assistant Features What is Teradata SQL Assistant? Teradata SQL Assistant is an information discovery tool designed for Windows operating systems. Teradata SQL Assistant retrieves data from any ODBC-compliant database server. The data can then be manipulated and stored on a desktop PC. Teradata SQL Assistant for Microsoft Windows User Guide, Release

22 Chapter 1: Getting Started Defining a Data Source How Teradata SQL Assistant Works Teradata SQL Assistant uses either a.net Data Provider or an ODBC connection to combine the data retrieved from a database with desktop applications such as Excel to create consolidated reports or to analyze the merged data. Teradata SQL Assistant records all SQL activity, complete with source identification, timings, row counts and notes. This is especially useful in data mining because the historical record can be used to build scripts from the SQL that produced positive results. Teradata SQL Assistant Features Teradata SQL Assistant provides several key functions: Creates reports from Teradata, Oracle or any Relational Database that provides an ODBC interface Exports data from the database to a file on a PC Imports data from a PC file directly to the database Uses an import file to create many similar reports (query results or Answersets) For example, display the DDL (SQL) that was used to create a list of tables. For more information, see Generating Multiple Reports From a Single Query on page 102. Sends queries to any supported database or send the same query to many different databases Creates a historical record of the submitted SQL with timings and status information such as success or failure Uses SQL syntax examples to tailor statements Uses the Database Explorer Tree to easily view database objects Uses a procedure builder that provides a list of valid statements for building the logic of a stored procedure Limits data returned to prevent runaway queries Creates charts from the returned data Defining a Data Source When connecting to a database, select either ODBC, the.net Data Provider for Teradata, or the.net Data Provider for Oracle. Connection to any other database must be made through an ODBC connection. In order to use the ODBC connection, a vendor specific 32-bit ODBC driver must be installed. In order to use a.net Data Provider, that provider must be downloaded and installed. See the following sections: Defining an ODBC Data Source Defining a.net Data Provider for Teradata Data Source Defining a.net Data Provider for Oracle Data Source 22 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

23 Chapter 1: Getting Started Defining a Data Source Note: The.NET providers only appear in the dropdown list if they have been installed on the client system. Defining an ODBC Data Source An ODBC-based application like Teradata SQL Assistant accesses the data in a database through an ODBC data source. After installing Teradata SQL Assistant on a workstation, start Teradata SQL Assistant. Then define a data source for each database. The Microsoft ODBC Data Source Administrator maintains ODBC data sources and drivers and can be used to add, modify, or remove ODBC drivers and configure data sources. An About Box for each installed ODBC driver provides author, version number, module size, and release date. Use the Microsoft ODBC Data Source Administrator program installed on the workstation to define a data source in one of two ways. To define an ODBC data source 1 Do one of the following: From the Windows desktop, select Start > Control Panel > Administrative Tools > Data Sources (ODBC). From within SQL Assistant select ODBC in the dropdown list to the left of the toolbar and then select Tools > Define Data Source. 2 In the ODBC Data Source Administrator dialog box, decide what type of data source to create. Table 1 describes the data source types. Table 1: ODBC Data Source Types Data Source Description User DSN System DSN File DSN Explanation An ODBC user data source stores information about how to connect to the indicated data provider. An ODBC system data source stores information about how to connect to the indicated data provider. A system data source is visible to all users on this machine, including NT services. An ODBC file data source connects to a data provider. File DSNs can be shared by users who have the same drivers installed. Note: File DSN is not recommended. 3 After selecting the DSN type, click Add. For example, in the ODBC Data Source Administrator dialog box, click the System DSN tab to bring to the front. Click Add, then click OK. Teradata SQL Assistant for Microsoft Windows User Guide, Release

24 Chapter 1: Getting Started Defining a Data Source 4 In the Create New Data Source dialog box, select the appropriate driver and click Finish. For example, locate the Teradata driver under the column Name, click to select the driver, and click Finish. A dialog box appears for the selected database. This dialog box requests information that defines the location of the database and the connection parameters to be used when establishing a connection. The parameters vary from one vendor database to another. Table 2 describes the basic parameters used to connect to a database. Table 2: ODBC Driver Setup for Teradata Database Dialog Box: Field Descriptions Select This Field... Name Description Name(s) or IP address(es) Do not resolve alias name to IP address Use Integrated Security Mechanism Parameter Username Password Default Database (optional) Account String (optional) To... Enter a name that identifies this data source. For example, in some cases there is more than one Teradata server to connect to or a user might have more than one logon depending on the function the user performs. Enter a description. This is solely a comment field to describe the data source name used. Enter the name(s) or IP address(es) of each LAN-connected node in the system, one per line. Entering only the first node name or IP address causes the client to communicate only with that node or IP address and can decrease system performance significantly. Define any names entered here in either Domain Name Services (DNS) or the local hosts file. The hosts file is located in the system32\drivers\etc subdirectory of the directory in which Windows is installed. Enter the name(s) or IP address(es) of the Teradata system. Note: Never enter both a name and an IP address. When this option is selected, setup routine does not attempt to resolve alias names entered into the Name(s) and IP address(es) box at setup time. Instead it is resolved at connect time. When cleared, the setup routine automatically appends COPn (where n = 1, 2, 3,..., 128) for each alias name entered. This causes other IP addresses associated with this server to be located, until a break in the sequence is detected. Select this option if logging on using integrated security measures. Leave this field blank to use the default mechanism. The authentication parameter is a password required for the selected mechanism. Enter a user name. Enter a password to be used for the connection if using Teradata SQL Assistant in an unattended (batch) mode. Entering a password here is not secure. Enter the default database name. If the Default Database is not entered, the Username is used as the default. All tables, views, and macros are assumed to be in this default database unless explicitly prefixed by a database name in the query. Enter one of the accounts that the DBA assigned to the Username when it was created. 24 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

25 Chapter 1: Getting Started Defining a Data Source Table 2: ODBC Driver Setup for Teradata Database Dialog Box: Field Descriptions (continued) Select This Field... Session Character Set To... Use the drop down menu to select the character set. The default is ASCII. Teradata SQL Assistant is ready to use. For more information about using Microsoft ODBC Data Source Administrator, refer to the ODBC Data Source Administrator Help system. Note: The SQL Assistant option Allow use of ODBC SQL Extensions in queries no longer exists. Clear the ODBC DSN option Disable Parsing to allow the use of ODBC SQL Extensions in queries. ODBC Driver Before using Teradata SQL Assistant to access the data in the database, first install an ODBC driver on the PC. Each database requires a driver that is designed specifically for that database system. Obtain the appropriate driver from an database vendor or from a third-party supplier. Compatibility Teradata SQL Assistant is certified to run with any Level 2 compliant 32-bit ODBC driver. The product also works with Level 1 compliant drivers, but might not provide full functionality. Consult the ODBC driver documentation to determine the driver s conformance level. Most commercially available ODBC drivers conform to Level 2. Defining a.net Data Provider for Teradata Data Source Use the Connection Information dialog box to create, edit, and delete data sources for.net Data Provider for Teradata. The dialog box is also used to connect to existing Teradata.Net data sources. Data source definitions are saved to a file named DataSources.config. This file is located in \Users\<username>\AppData\Teradata\SQL Assistant. Additionally, system level data sources can be defined. These are stored in a file of the same name, located in \ProgramData\Teradata\SQL Assistant. When a System level data source is selected, a padlock icon appears to the right of the data source name. For a Windows user with Standard rights, many of the properties within such a data source can not be changed. A user with Administrative rights can change any property. However, if he or she changes certain properties, a new user level data source is created. This user level data source appears instead of the system level data source going forward. If he or she later deletes that data source, the original System level data source is restored. To define a Teradata.NET data source 1 Open Teradata SQL Assistant. 2 Select Teradata.NET from the provider drop down list, next to the Connect tool button. Teradata SQL Assistant for Microsoft Windows User Guide, Release

26 Chapter 1: Getting Started Defining a Data Source 3 Click the Connect icon or go to Tools > Connect. 4 Use the Connection Information dialog box to select a.net data source. Create a new data source by entering the name and server and other applicable information Delete an existing data source by clicking Delete. Use this dialog box to modify existing sources. 5 Use the Advanced tab to make additional changes to a data source. The figure below shows the.net dialog box. Table 3 describes the options in the.net dialog box. Table 3: Description of the Teradata.NET Connection Dialog Box Dialog Box Item Description Basic tab 26 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

27 Chapter 1: Getting Started Defining a Data Source Table 3: Description of the Teradata.NET Connection Dialog Box (continued) Dialog Box Item Data Source Name Server Use Integrated Security Mechanism Parameter User Name Password Default Database Account String Description Enter the name of the data source or use the drop down menu to select an existing name. Enter the name of the data source or the IP address. Use your Windows credentials for this connection. Select a security mechanism and parameter. The default Mechanism is used if this is left blank. Enter your security parameters if required by the selected Mechanism. Enter the appropriate user name information. Enter the appropriate password information. Enter the default database if applicable. If the Default Database is not entered, the Username is used as the default. All tables, views, and macros are assumed to be in this default database unless explicitly prefixed by a database name in the query. Enter the default account string if applicable. Advanced tab Session Character Set Session Mode Use the drop down menu to select a character set to be associated with the data source. Use Session Mode to select the type of session. Options include ANSI, DEFAULT, and TERADATA. Response Buffer Size Enter a buffer size between 4096 and The default is Port Number Enter a port number. The default is Connection Timeout Data Source DNS Entries Use X views Use Data Encryption Verify Message Integrity Use Enhanced Schema Enter the length of time in seconds that SQL Assistant should wait for a connection to be established before determining that the system is unavailable. The default setting is 20 seconds. [Optional] Enter the number of IP Addresses defined for the Teradata system (1 to 999). The default setting is blank. Select this box to force the driver to read the X (restricted) views instead of the regular views when fetching catalog data for the Database Tree. Note: This option makes retrieving Database Tree information less efficient but might be required due to security restrictions for some users. Select this box to use data encryption. Select this box to set the.net Data Provider to perform integrity checks on all messages sent to and received from Teradata. The box is not selected by default. Select this box to set the.net Data Provider to return additional metadata information. This option also controls whether the StatementInfo parcel is returned by the database. The box is selected by default. Teradata SQL Assistant for Microsoft Windows User Guide, Release

28 Chapter 1: Getting Started Defining a Data Source Table 3: Description of the Teradata.NET Connection Dialog Box (continued) Dialog Box Item Show Color Bar Description Select this box to display a narrow bar of color across the top of any Query window that is connected to this data source. Use the Color selection control to the right to select a color. This same color is used to underline the Data Source name in the Database Explorer Tree when you are connected to this data source. Defining a.net Data Provider for Oracle Data Source Use the Connection Information dialog box to create, edit, and delete data sources for.net for Oracle. The dialog box is also used to connect to existing Oracle.NET data sources. To define an Oracle.NET data source 1 Open Teradata SQL Assistant. 2 Select Oracle.NET from the provider drop down list next to the Connect tool button. 3 Click the Connect icon or select Tools > Connect. 4 Use the Connection Information dialog box to select a.net data source. Create a new data source by entering the name, server, and other applicable information. Delete an existing data source by clicking Delete. Use this dialog box to modify existing sources. 5 Use the Advanced tab to make additional changes to a data source. The following figure shows the.net dialog box. Table 4 describes the options in the.net dialog box. 28 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

29 Chapter 1: Getting Started Defining a Data Source Table 4: Description of the Oracle.NET Connection Dialog Box Dialog Box Item Description Basic tab Data Source Name Server Use Integrated Security User Name Password Enter the name of the data source or use the drop down menu to select an existing name. Enter the name of the data source or the IP address. Use your Windows credentials for this connection. Enter the appropriate user name information. Enter the appropriate password information. Advanced tab Proxy User Proxy Password Connection Timeout Show Color Bar Enter the Proxy user to connect through. Enter the password for the Proxy user. Enter a time limit in seconds for SQL Assistant to establish a connection to an available system before timing out. The default setting is 20 seconds. Select this box to display a narrow bar of color across the top of any Query window that is connected to this data source. Use the Color selection control, to the right, to select a color. This same color is used to underline the Data Source name in the Database Explorer Tree when you are connected to this data source. Teradata SQL Assistant for Microsoft Windows User Guide, Release

30 Chapter 1: Getting Started Starting Teradata SQL Assistant Starting Teradata SQL Assistant After installing the.net Data Provider for Teradata, Teradata SQL Assistant, and any required ODBC drivers, or the.net Data Provider for Oracle, start Teradata SQL Assistant. To start Teradata SQL Assistant From the Windows desktop, select Start > Programs > Teradata Client > Teradata SQL Assistant > Teradata SQL Assistant. The Teradata SQL Assistant main window appears with a blank Query Window above and a History window below. Connecting to and Disconnecting from a Data Source Before connecting to an ODBC data source, a.net data source, or both, the data sources should be defined. See Defining an ODBC Data Source on page 23 or Defining a.net Data Provider for Teradata Data Source on page 25. More than one data source can be connected at a time if the option is selected on the Options dialog box under the General tab. The following topics provide information about data source connections: Setting General Program Preferences Connecting to an ODBC Data Source Connecting to.net for Teradata Connecting to.net for Oracle Connecting to Multiple Data Sources Re-Connecting to a Data Source Displaying a Color Bar in the Query Window Changing the Database Password 30 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

31 Chapter 1: Getting Started Connecting to and Disconnecting from a Data Source Connecting to an ODBC Data Source After defining the ODBC data source, connect to it. To connect to an ODBC data source 1 Use the provider drop down menu to select ODBC data source. 2 Do one of the following: Select Tools > Connect. On the toolbar click. The prompt asks for the name of the data source. 3 Select a data source and click OK. 4 In the Teradata Database Connect dialog box: a b Do one of the following: Select Use Integrated Security Enter the Mechanism and Parameter Enter the Userid and Password [Optional] Enter a Default Database or an Account String. When the connection is complete, the Connect icon can be disabled and the Disconnect icon to its right enabled. The connect icon is disabled only if connection to multiple data sources is not allowed. For more information on the fields in this dialog box, refer to the ODBC Driver for Teradata User Guide. When Connected to ODBC The following lists describes what occurs when connection is established with an ODBC source: All columns are returned as character strings when Interval columns are selected, so you cannot select LOBs or Byte columns if the Select includes Interval columns. You can only select CLOBs if connecting using the UTF-16 Session Character Set. Only type F User Defined Functions are listed under the Functions node of the Database tree. Time columns do not display fractional seconds or Time Zone information. Decimal columns with more than 28 digits might display incorrectly. Teradata SQL Assistant for Microsoft Windows User Guide, Release

32 Chapter 1: Getting Started Connecting to and Disconnecting from a Data Source If a macro (or execute parallel) returns zero rows from a Select statement, no rows are returned from any later Select statements in that macro or parallel query. Batch Import functionality is not available. The Edit Table function is not available. The location of Syntax errors will not be highlighted. Connecting to.net for Teradata Use the following procedure to connect to a.net for Teradata data source. For more information on defining.net data sources, see Defining a.net Data Provider for Teradata Data Source on page 25. To connect to a.net for Teradata data source 1 Use the Provider drop down menu to select Teradata.NET. 2 Do one of the following: Select Tools > Connect. On the toolbar click. The Teradata.NET Connection Information dialog box opens. 3 Select the data source and enter the applicable information. When Connected to a Teradata.NET Data Source The following list details what occurs when a connection is established with a Teradata.NET data source: Teradata.NET always uses ANSI date mode. All date literals must be entered in 'YYYY-MM-DD' format. Timestamp With Time Zone columns only sort correctly if you specify a date format of 'YYYY-MM-DD'. A WITH (summary) clause in a Select statement causes the data return to fail. Connecting to.net for Oracle For more information on defining.net data sources, see Defining a.net Data Provider for Oracle Data Source on page Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

33 Chapter 1: Getting Started Connecting to and Disconnecting from a Data Source To connect to a.net for Oracle data source 1 Use the Provider drop down menu to select Oracle.NET. 2 Do one of the following: Select Tools > Connect. On the toolbar click. The Oracle.NET Connection Information dialog box opens. 3 Select the data source and enter the applicable information. When Connected to an Oracle.NET Data Source The following list details what occurs when a connection is established with a Oracle.NET data source: Decimal columns with more than 28 digits might be displayed as <Error>. The correct case for Database/User names (generally Uppercase) must be used. This applies to the Connection dialog box, when adding Databases to the Explorer tree, or when enclosing object names within double quotes. Create Procedure statements must end with a semicolon. These statements create, but not compile, the procedure. The procedure must be compiled before it can be executed. Connecting to Multiple Data Sources Use the following procedure to connect to multiple data sources. To connect to multiple data sources 1 Select the Tools > Options > General tab. 2 Click Allow connections to multiple data sources (Query windows), 3 Follow the procedure for connecting to a data source. Each new data source appears in the Database Tree and opens a new query window with the data source name in its caption. To disconnect from a data source, click the Query window that is connected to that data source and click the disconnect icon. Teradata SQL Assistant for Microsoft Windows User Guide, Release

34 Chapter 1: Getting Started Connecting to and Disconnecting from a Data Source Re-Connecting to a Data Source Use the following procedure to reconnect to a data source to which the Query window was previously connected if the connection was dropped due to a network problem or the PC entering Hibernation. To reconnect to a data source Do one of the following: Select Tools > Reconnect. On the toolbar, click. Displaying a Color Bar in the Query Window Use the following procedure to display a colored stripe across the top of a Query window. This provides visual feedback related to the data source to which the Query is connected. To display a color bar in the Query window 1 When connecting to a Teradata.NET or Oracle.NET data source, click the Advanced tab. 2 Select the Show Color Bar check box. 3 Use the color selection dropdown control to select a color. Changing the Database Password Use the following procedure to change the password in the database for Teradata, Oracle, MySQL and SQL Server databases. It might not be possible to change the password on all database systems, like Microsoft Access. Changing the password in the Database does not change a password that is stored in the ODBC data source definition. Storing a password in the ODBC data source is not secure and is not recommended. To change the database password 1 Select Tools > Change Password. 2 In the Change Database Password dialog box, enter the current password. 3 Enter the new password. Note: Do not use the semicolon (;) or the equal sign (=) when changing database passwords if any ODBC or.net-based applications are being used. 4 Re-enter the new password to confirm it. 34 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

35 Chapter 1: Getting Started Main Window Main Window The Query Window is used to enter and execute a query. The results from queries are placed into one or more Answerset windows. See Introduction to the Query Window on page 63. The Answerset window is a table that Teradata SQL Assistant uses to display the output of a query. See Introduction to the Answerset Window on page 105. The History window is a table that displays past queries and related processing attributes. The past queries and processing attributes are stored locally in a Microsoft Access database. This provides flexibility to work with previous SQL statements in the future. See Introduction to the History Window on page 137. In addition to the three main windows, the optional Database Explorer Tree and Favorites panes can be displayed at the left or right side of the main window. For more information on these features, see Database Explorer Tree on page 38 or Favorites and Examples Pane on page 51. Menu Bar The Teradata SQL Assistant main window features a menu bar that contains menus that display a list of commands. The available commands apply to the active window. To find information on main menu items, refer to the Index under the main menu name. For information on customizing menus, see Customizing Menus and Toolbars on page 173. Hiding Toolbars The toolbars contain tool buttons used to perform the functions of the more commonly used menu commands. For information on customizing toolbars, see Customizing Menus and Toolbars on page 173. To hide the toolbars Select View > Toolbars and then select the toolbar to be hidden. Using the Status Bar The status bar appears across the bottom of the main window and displays the following status information: The status of an action or descriptive information about the menu or tool button that the mouse currently hovers over For example, after executing a query, the status bar displays a success or failure message for that query. Teradata SQL Assistant for Microsoft Windows User Guide, Release

36 Chapter 1: Getting Started Main Window Note: If a message is too long to fit on the status bar, click on it to display the full message in a message box. The sum, count, average and standard deviation for the highlighted block of cells in the Answerset window To display this information, see Displaying Aggregate Values on page 111. The name of the Data Source from which the data was retrieved when an Answer set window is active, or the name of the Data Source to which the Query window is connected if a Query window is active The line number of the cursor position in the Query window The line number is useful for locating syntax errors in stored procedures. The length of the selected text if any text is selected in the Query window The current zoom factor The current time By default this displays only the hour and minutes. Click on it to display seconds also. Click on it again to return to the default display. Tabbing Windows To hide the Status Bar Select View > Status Bar. Query, History, and Answerset windows can be displayed as tabbed windows instead of the usual Tiled, Cascaded, or Maximized options. When tabbed, the windows can be split into two tab groups to allow the easy comparison of the contents of each window. To tab windows Under Window on the toolbar, select Tabbed. The open windows arrange in tabs. After the window is tabbed, a second tab group can be opened either by right-clicking on a tab and using the menu, or by dragging the tab to any edge of the window. (Dragging to a side opens side by side tab groups, while dragging to the top/bottom opens one tab group above the other.) A tabbed window can also be dragged to a new location within its own tab group, or to another tab group. 36 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

37 Chapter 1: Getting Started Main Window Cascading Windows Use the following procedure to display all the open windows, using the cascade function. To cascade windows Do one of the following: On the toolbar click. Select Window > Cascade. Press Shift+F5 Tiling Windows Use the tiling function to display all of the open windows. To tile windows Arranging Windows Do one of the following: On the toolbar click. Select Window > Tile Horizontal or Tile Vertical. Press Shift+F4 or Shift+F6 Use the following procedure to arrange all minimized windows in a row across the bottom of the Teradata SQL Assistant window. To arrange icons Select Window > Arrange Icons. Changing the text size in a child window Use the following procedure to change the text size used in a child window. To increase/decrease the text size in a child window 1 Ensure the window is active. 2 Hold the Ctrl key and spin the mouse wheel, or press the + or - keys. The display zooms in or out. 3 To restore the zoom level to its original size (100%) press Ctrl+0 Teradata SQL Assistant for Microsoft Windows User Guide, Release

38 Chapter 1: Getting Started Database Explorer Tree Using Online Help The following procedure explains how to use the help menu items. To display help menu items Do one of the following: Select Help > Help Topics. On the toolbar click. To display context-sensitive help Press F1 anywhere in the program. To display information about SQL Assistant The About screen provides useful information about SQL Assistant and the current session, including the software version of SQL Assistant, the type and version of the connected server, and information about the ODBC driver or.net Data Provider. Select Help > About SQL Assistant. Using Shortcut Menus and Commands To find information on menu items, refer to the Index under the menu name. Information on the shortcut menus for each window can be found as follows: Using the Query Window Shortcut Menu Using Answerset Shortcut Menus The History Window Shortcut Menu Displaying the Shortcut Menu Customizing Shortcut Menus Shortcut menus can be customized. For more information, see Customizing Menus and Toolbars on page 173Customizing Menus and Toolbars. Database Explorer Tree The Database Explorer Tree can be displayed at the left or right side of the main Teradata SQL Assistant window. This pane displays each of the Data Sources to which you are connected. It also displays data sources to which you were previously connected if you use the option to save Data Source information. Opening a data source displays an alphabetical list of databases on that Data Source. Double-click a database name to expand the tree display for that database. 38 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

39 Chapter 1: Getting Started Database Explorer Tree Use the Database Explorer Tree to reduce the time required to build a query, help reduce errors in object names, or generate statements for a table. Initially, the following databases load into the Database Explorer Tree: The user's default database The User ID that was used to connect to the database (if applicable) The catalog database defined in the Vendors.config file for the database vendor (for example, DBC when connecting to a Teradata data source) Any databases that were previously requested to be loaded for this data source Below each database name the following folders display: Tables Views System Tables (not for Teradata) Join Indexes or Materialized Views (optional) Macros (for Teradata data sources only) Functions Procedures Viewing Object Types The Database Explorer Tree shows the objects in the various databases shown. The following procedures explain how the Explorer Tree works. To expand the Explorer Tree to show all the objects Do one of the following: Double-click the database name or folder. Click the plus sign (+) next to the database name or folder. Highlight the database name or folder, and press Enter or the right arrow key. Right-click on the database name or folder, then select Expand/Collapse on the shortcut menu. The following notes apply to the Database Tree: Expanding the Tables, Views or System Tables folder loads all these object types. Expanding the Macros, Functions or Procedures folder loads all these object types. If no objects exist for a given object type, that folder is automatically removed. When an index node is expanded for a Table, the approximate index cardinality (number of unique values) appears after the column name(s). When expanding the Tables node of a database any Global Temp Tables in that database are listed in blue. Join Indexes (called Materialized Views or Materialized Query Tables by some vendors) are only displayed if requested on the DB Tree tab of Options. Teradata SQL Assistant for Microsoft Windows User Guide, Release

40 Chapter 1: Getting Started Database Explorer Tree To collapse the Explorer Tree to hide all of the objects Do one of the following: Double-click the database name or folder. Click the minus sign (-) next to the database name or folder. Highlight the database name or folder, and press Enter or the left arrow key. Right-click on the database name or folder, then select Expand/Collapse on the shortcut menu. Opening and Closing the Database Explorer Tree To open or close the Database Explorer Tree Do one of the following: On the toolbar click. Select View > Explorer Tree. The check mark displays the status by toggling on or off. Navigating to the Database Explorer Tree Use the following procedure to move focus to the Database Explorer Tree. To navigate to the Database Explorer Tree Do one of the following: Select View > Go To Explorer. Press Ctrl+G. Changing the Width of the Tree Area To change the width of the Explorer Tree area Click on the right edge of the display and drag it to a new position. Moving the Explorer Tree Window The Database Explorer Tree window operates as a separate window that can be moved around and docked to the left or right side of the parent window or can float independently. The Database Explorer Tree also has an auto-hide feature that causes it to collapse to a bar when the mouse moves away from the window. 40 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

41 Chapter 1: Getting Started Database Explorer Tree To move the Database Explorer Tree To move the Database Explorer Tree, do the following: Click the caption bar of the Database Explorer window and drag it to a desired location. When the cursor is close to the left or right edge of the main window, it displays a bold outline indicating that it is ready to dock to that side. Otherwise it floats when the mouse button is released. If the Database Tree and Favorites pane appear as tabs and you only want to move one of them, click on the tab itself and drag that to the desired location. To auto-hide the Database Explorer window, do one of the following: 1 Click the push pin on the caption bar to activate auto-hide or unpin the Explorer Tree. When you move the mouse away from the Explorer Tree, the window collapses to a bar at the side of the main window. When you move the mouse over the Explorer Tree tab on the bar, the Database Explorer Tree window reopens. 2 Click again to turn off auto-hide. Dragging Object Names to the Query Pane Click and drag the object from the Explorer Tree to the Query pane. The name of the object appears in the Query Window. To add a comma after the object name when it is dragged to the Query pane, press the Ctrl key before clicking on the object name. To qualify object names with their parent name when dragging an object to the Query Window, first select the option Qualify names when dragged or pasted from the Database Tree, on the DB Tree tab of the Options dialog box. Dragging Multiple Objects Use the Shift and Ctrl keys to select more than one object from the Database Explorer Tree that can be dragged to the Query window. Use the Ctrl key to select additional objects. Use the Shift key to select a range of objects. Teradata SQL Assistant for Microsoft Windows User Guide, Release

42 Chapter 1: Getting Started Database Explorer Tree Using Quick Paste Quick paste allows you to easily move objects from the Explorer Tree to the query window. To use quick paste Perform a quick paste in one of the following ways: Double-click a column name in the Database Explorer Tree to quickly move it to the Query window. Select the object, then right-click and select Quick Paste from the menu. The object is immediately pasted into the Query window. Adding Double Quotes around Object Name Adding Object Types Request that double quotes be automatically added around any object name that is dragged or quick pasted from the Database Tree by checking the option Enclose names in quotes when dragged or pasted from the Database Tree on the DB Tree tab of the Options dialog box. A newly created object does not appear in the Database Explorer Tree until the parent folder opens. If the parent folder is already open or has been opened during the current session, the new object does not appear until after the Refresh Database command is used, or disconnect and reconnect to the database. The same holds true when deleting an object. Table 5 shows the subfolders that are created when objects are added. For more information, see Refreshing the Database Explorer Tree on page 48. Table 5: Sub Folders Created When Objects Are Added When adding a... Table View Macro Function Procedure the following subfolder(s) are added... Columns and Indexes Triggers (only displayed if requested on the DB Tree tab of Options) Columns Parameters Displaying Object Definitions Use the following procedures to display the text (the DDL or data definition language) used to create a table, view, macro or stored procedure in the Database Explorer Tree. The resulting text appears in the Answerset or Query window depending on which procedure you use. 42 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

43 Chapter 1: Getting Started Database Explorer Tree To display the text used to create an object in the Answerset window Right-click on the object, then select Show Definition. Abort the data retrieval process at any time by clicking the Abort icon on the toolbar. The results appear in the Answerset window. Definitions are available as follows: Tables Full definition for Teradata Column information only for most other vendors All other object types availability varies by vendor Note: The definition for a Function or Procedure might not always be available. To display the text used to create an object in the Query window Right-click on the object, then select Generate SQL > Create. Abort the data retrieval process at any time by clicking the Abort icon on the toolbar. The results appear in the Query window. Definitions are available as follows: Tables Full definition for Teradata Column information only for most other vendors Other objects Availability varies by vendor Note: The definition for a Function or Procedure might not always be available. Displaying Data Source Information Hover the mouse over the data source node. The User Name and Default Database for that data source are displayed. Generating SQL for use with an Object Use the following procedure to insert a statement template for the selected Table or View into the Query Window rather than dragging individual column names to build a statement that references many columns of a table. If the Ctrl key is pressed when the menu is clicked, the SQL is inserted into the current Query tab at the cursor position. If the Ctrl key is not pressed, the SQL displays in a new Query tab if Teradata SQL Assistant for Microsoft Windows User Guide, Release

44 Chapter 1: Getting Started Database Explorer Tree the current query has been changed since it was last saved or executed, or the SQL replaces the current query if it has not been changed since it was last saved or executed. To insert SQL for the selected table or view into the Query Window 1 Right-click on the object and select Generate SQL. 2 Click on one of the sub menus to insert the SQL. Table 6 provides examples of the submenus. Table 6: Generate SQL Sub Menus Menu Item Select Insert (Values) Insert (Import) Create Inserted SQL Example Select col1, col2, col3 From MyTable Insert Into MyTable (col1, col2, col3) Values (col1 [Integer], col2 [Char(5)], col3 [BLOB]) Insert Into MyTable (col1, col2, col3) Values (?,?,?B) Inserts the DDL of the object Editing Table Data The following steps explain how to directly edit the data in a table or simple view. Note: This functionality is not available when connected by ODBC. 44 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

45 Chapter 1: Getting Started Database Explorer Tree To edit table data 1 Right-click on a Table or View name in the Database Explorer Tree, and then select Edit Table. The Edit Table Filter dialog box appears. 2 In the Edit Table Filter dialog box, deselect any columns that you do not want in the output. Note: The selected columns must include a unique column or key if you plan to update the data. LOB columns do not appear in the list. Columns defined as Not Null are disabled because they are always selected. 3 [Optional] Enter a Where clause to limit the rows returned and an Order by clause to specify the initial sort order of the displayed rows. 4 Press OK to display the matching data in the Edit Table dialog box. Working with the Edit Table Dialog Box When the Edit Table dialog box first appears it is in read-only mode. To enter edit mode, do one of the following: Double-click the cell to edit. Navigate to the row to edit and press Enter to enter edit mode for the first column in the row. Press Tab to move to other cells in the row. After editing a cell you can do the following: Teradata SQL Assistant for Microsoft Windows User Guide, Release

46 Chapter 1: Getting Started Database Explorer Tree Click or press Enter Tab Esc Mouse button To To accept the new value and exit Edit mode To accept the new value and edit the next cell Revert to the old value and exit Edit mode To accept the new value and exit Edit mode Note: In many cases you cannot exit edit mode if you enter a value that is invalid for the underlying data type. If this occurs, either correct the value or press Esc to revert to the original value. After a value has been changed, the Update and Revert buttons are enabled and the background color of the row changes. The default color is gold, but it can be changed using the Code Editor tab of the Options dialog box. After making all changes, press Update to apply them to the underlying table. If all changes are successful the background color of the updated rows revert to normal. If any row(s) fail to update due to table constraints and so forth, an error message appears and those rows retain their changed background. Click on each row to display a message indicating the error that occurred. To edit large text values If you try to edit a character value whose column is defined as larger than 80 characters or whose value contains a carriage return, the Edit Text Cell dialog box appears. 1 Double-click or press Enter to enter Edit mode. The Edit Text Cell dialog box appears with the text shown in a multi-line text box. 2 Make your changes to the text, then press Save to accept the change or press Cancel to discard the change. To insert new rows into the table 1 Double-click the Insert row to enter Edit mode. The Insert row is immediately below the column titles, indicated by an asterisk in the left margin and a pale cream (default) background. 2 Enter a value for each non-null column. As soon as you exit edit mode, the new row moves down to the main grid area and the top row becomes available for adding another row. Newly added rows also display the changed background color until the Update button has been pressed. 46 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

47 Chapter 1: Getting Started Database Explorer Tree To delete rows from the table 1 Select the rows to be deleted. 2 Right click and press Delete Rows. 3 Click Yes when asked for delete confirmation. The deleted rows immediately disappear from the grid but are not removed from the underlying table until Update is pressed. Adding Databases To discard changes without applying them to the table Press the Revert button. The data is reloaded from the underlying table and all rows revert to the default background color. The following steps explain how to add additional databases to the Database Explorer Tree. Removing Databases To add additional databases 1 Do one of the following: With the Database Explorer Tree active, press Insert. Right-click anywhere in the Database Explorer Tree, then select Add Database. 2 Type the database name to be added. 3 Clear the check box to load the database only for the current session. By default, the check box is selected so the database appears in the Database Explorer Tree in future sessions. To remove databases from the Database Explorer Tree, use the following procedure. If a database is removed by mistake, it can be added again. See Adding Databases on page 47Adding Databases. To remove a database Do one of the following: Click on the database name and press Delete. From the Database Explorer Tree, right-click on the database name and click Remove Database. Note: The default database can not be removed from the Database Explorer Tree. Teradata SQL Assistant for Microsoft Windows User Guide, Release

48 Chapter 1: Getting Started Database Explorer Tree Refreshing the Database Explorer Tree The following steps explain how to refresh the objects shown below a database in the Database Explorer Tree. To refresh the objects shown below a database 1 From the Database Explorer Tree, right-click the database. 2 Select Refresh Database. Note: Only object types previously expanded are refreshed. Displaying the Shortcut Menu There are several ways to display additional menu options. Table 7 describes all of the commands. Table 7: Explorer Tree Shortcut Menu Commands To display commands for the Database Explorer Tree Window Do one of the following: Right-click an object and select a menu item. Press Shift+F10. Press Context Menu on the keyboard. Command Quick Paste Show Definition Expand/Collapse Add Database Refresh Database Remove Database Description Pastes the current object name into the Query Window. The name is inserted at the current insertion point. To insert the name at a different point, drag and drop it within the query text. Displays the text used to create an object in the Database Explorer Tree. The DDL (data definition language) of a table, view, macro or stored procedure appears in the Answerset Window. Right-click the object to show the definition, then select this command. Expands or collapses the display for the selected object. If the selected object has not been previously opened, the child data (for example, the list of tables) is fetched from the database. If the selected object has no children, it is removed from the tree. Adds additional databases to the Database Explorer Tree. Refreshes the objects shown below a database in the tree. Right-click the database to refresh, then select this command. Note: Only object types previously expanded are refreshed. Removes a database from the Database Explorer Tree. 48 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

49 Chapter 1: Getting Started Database Explorer Tree Table 7: Explorer Tree Shortcut Menu Commands (continued) Command Description Generate SQL The commands on this menu generate and insert SQL into the Query window. An example of the inserted SQL is shown for each command below. In these examples <name> is the Table or View name <a, b, c,...> is the list of columns in that table or view Select Select <a, b, c,...> from <name>. Insert (Values) Insert into <name> ( <a, b, c,...>) Values (<a [datatype], b [datatype], c [datatype],...>) Insert (Import) Insert into <name> ( <a, b, c,...>) Values (?,?,?,...) Create Create Table <name> ( <a [datatype], b [datatype], c [datatype]> ) Primary Index (x) Setting Database Tree Preferences To set database tree preferences 1 Select Tools > Options. 2 Click the DB Tree tab. Teradata SQL Assistant for Microsoft Windows User Guide, Release

50 Chapter 1: Getting Started Database Explorer Tree Table 8: Options Dialog Box, DB Tree Tab 3 Select from the options shown in Table 8. Options Load my user defined list of databases Load the databases and users from a Table or View Load from this source Exclude all users except for DBC and myself Save Database Tree information to disk and reload it at startup Description This is the default option. The user DBC, current logon user, default database, and any databases or users previously defined for this data source are loaded. This option is only available when connecting to a Teradata data source. This option reads the database names from the table or view specified in the next field. Enter the name of the table or view to load database names from. By default, this view name is DBC.DatabasesVX. If an unqualified name is entered, the assumption is that the name is in database DBC. This table/view must contain the columns DatabaseName and DBKind. DBKind should be set to D to indicate a database. Any other value is assumed to be a User. The default is selected. When selected, all databases are loaded, and users are excluded. The only users that are loaded are DBC and the current logon user. The default is cleared. When selected, all the information currently in the database tree is saved to disk before Teradata SQL Assistant is shut down. The database tree information is reloaded when opened again. The column information automatically loads for all tables and views in the database when you expand the Tables or Views folders in the database tree. 50 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

51 Chapter 1: Getting Started Favorites and Examples Pane Table 8: Options Dialog Box, DB Tree Tab (continued) Options Load only column names for Views Much faster (Teradata only) Qualify Names when dragged or pasted from the Database Tree Enclose names in quotes when dragged or pasted from the Database Tree Display Triggers, Join Indexes and Materialized Views Use alternate schema when loading the Explorer Tree for Unknown vendors Description The default is cleared. This option is only available when Save Database Tree information to disk and reload it at startup is selected. Select this option to load only the column names for Views. Using this option speeds up the amount of time it takes to load database information for a database that contains many views. The default is cleared. When selected, Table, Column, and other names are qualified with their parent name when dragged from the Explorer Tree, or when the Quick Paste menu is used. The default is cleared. When selected, names are enclosed in double quotes when dragged from the Explorer Tree, or when the Generate SQL or Quick Paste menus are used. The default is cleared. When selected an Indexes node is added below each database. This node can be expanded to display the Join and Hash Indexes defined in the database. In addition, a Triggers node is added below each Table. Note: The term Indexes are only used for Teradata data sources. Other terms such as Materialized Views are used for other vendors, as appropriate. Select this item if you are connected to an unknown (unsupported) database and no objects appear in the Explorer Tree. Favorites and Examples Pane The Favorites and Examples pane can be displayed at the left or right side of the main Teradata SQL Assistant window. This pane displays any SQL Sets that you have created, in addition to the syntax examples for any database to which you are connected. Expanding an SQL Set node displays an alphabetical list of the statements in that set. Double-click a statement to Quick- Paste it into your Query at the current insertion point. Alternatively, you can drag the statement and drop it at any point within your Query. Opening and Closing the Favorites Pane To open or close the Favorites pane Do one of the following: Select View > Show Favorites. On the toolbar click. The check mark displays the status by toggling on or off. Teradata SQL Assistant for Microsoft Windows User Guide, Release

52 Chapter 1: Getting Started Favorites and Examples Pane Navigating to the Favorites Pane Use the following procedure to move focus to the Favorites and Examples pane. To navigate to the Favorites pane Do one of the following: Select View > Go To Favorites. On the toolbar click. Press Ctrl+Shift+G. Changing the Width of the Favorites Pane To change the width of the Favorites pane Click on the right edge of the display and drag it to a new position. Moving the Favorites Pane Window The Favorites pane operates as a separate window that can be moved around and docked to the left or right side of the parent window or float independently. The Favorites pane also has an auto-hide feature that causes it to collapse to a bar when the mouse moves away from the window. To move the Favorites pane To move the Favorites pane, do the following: Click the caption bar of the Favorites pane and drag it to a desired location. When the cursor is close to the left or right edge of the main window, it displays a bold outline indicating that it is ready to dock to that side. Otherwise it floats when the mouse button is released. If the Database Tree and Favorites pane appear as tabs and you only want to move one of them, click on the tab itself and drag it to the desired location. To auto-hide the Favorites pane, do one of the following: Click on the caption bar to activate auto-hide or unpin the Favorites pane. When you move the cursor away from the Favorites pane, the window collapses to a bar at the side of the main window. When you move the cursor over the Favorites tab on the bar, the Favorites pane window reopens. Click again to turn off auto-hide. 52 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

53 Chapter 1: Getting Started Listing All Tables or Views In a Database Listing All Tables or Views In a Database To list the tables or views of any database 1 Do one of the following: Select Tools > List Tables. On the toolbar click. 2 In the Database Name field, type the name of the database (or owner, if using Oracle) containing the tables. Enter the following wildcard characters in this field: Note: Wildcard characters only function when using an ODBC connection. "_" Matches any single character "%" Matches zero or more characters If the name is specified as a single percent sign ("%") this has special meaning to some ODBC drivers. It requests a list of all databases on the system, rather than all Tables within all Databases. To display all tables in all databases it is safer to specify either "%%" or "_%". Note: This field does not apply to Microsoft Access databases. 3 At least one of the following must be selected: Show Tables lists the tables in the selected database. Show Views lists the views in the selected database. The resulting list of tables, views and/or system tables appears in an Answerset window. This window does not automatically close when new queries are submitted. Listing All Columns In a Table or View To list the columns in a table or view 1 Do one of the following: Select Tools > List Columns. On the toolbar click. 2 In Database Name field, type the name of the database (or owner, if using Oracle) containing the table or view. This field does not apply to Microsoft Access databases. 3 In Table or View Name, type the name of the table or view. The resulting list of columns appear in an Answerset window. This window does not automatically close when new queries are submitted. Teradata SQL Assistant for Microsoft Windows User Guide, Release

54 Chapter 1: Getting Started Setting General Program Preferences Setting General Program Preferences This section includes information about the following: Setting Default File Paths Using Page Setup Using Print Preview The following steps explain the available options under the General tab and how to control basic program behavior by setting options. To set general program preferences 1 Select Tools > Options. 2 Click the General tab. 3 Select from the options shown in Table Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

55 Chapter 1: Getting Started Setting General Program Preferences Table 9: Options Dialog Box, General Tab Options Allow connections to multiple data sources (Query windows) Allow multiple queries per connection (Tabs in a query window) Print the related SQL when printing an Answerset Provide extended support for screen readers Use a separate Answer window for Application Style Base Font Size Description Select this box to allow SQL Assistant to connect more than one data source. The Connect icon remains active. The default for this setting is cleared. Allows multiple query tabs to be opened within a Query window. With this option selected, the New Query command opens a new tab in the current Query Window. The default for this setting is selected. Select this option to print the SQL statement that is associated with the Answerset to be printed. Note: The SQL statement does not display in the Print Preview window but is printed. Select this option if you are visually impaired and you use a screen reader. This causes your screen reader to announce the contents of the Answerset and History cells as you move from one cell to another. The default for this setting is cleared. Each Resultset opens a new Answer window for each new result set Each Query opens a new Answer window for each new query, but uses tabs within this window if the query returns multiple result sets This is the default setting. Never directs all query results to display in a single tabbed Answer window This option changes the look and feel of SQL Assistant. Select from Office2000, Office2003, OfficeBlue, OfficeBlack, OfficeSilver, Windows Vista, Windows 7 or Windows 8. The Office<color> items will imitate Office2010. The default is OfficeBlue. Changes the size of the fonts used in the main window and all dialog boxes. Select between Standard, Larger, and Largest. Setting Default File Paths To set default file paths 1 Select Tools > Options. 2 Click the File Paths tab. Teradata SQL Assistant for Microsoft Windows User Guide, Release

56 Chapter 1: Getting Started Setting General Program Preferences Table 10: Description of the File Paths Options 3 Enter file paths for the options shown. See Table 10 for option descriptions. Option Query files Answer files Import and LOB files History file Description The Open/Save Query functions point to this directory the first time they are used. Subsequent open/save operations point to the most recent directory used. The default path is \<user name>\my Documents. The Open/Save Query functions point to this directory the first time they are used. Subsequent open/save/export operations point to the most recent directory used. The default path is \<user name>\my Documents. Import operations initially point to this directory for import files. This is also the default location for storage of any large objects that are retrieved. The default path is \<user name>\my Documents. History information is loaded from the SQLHistory.mdb file stored in this directory. If you change this path to a directory that does not contain an SQLHistory.mdb file, Teradata SQL Assistant opens and converts any history file created by an earlier version of Teradata SQL Assistant. If a previous version is not found, a new, empty history database is created. The default path is \<user name>\appldata\roaming\teradata\sql Assistant. 56 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

57 Chapter 1: Getting Started Setting General Program Preferences Using Page Setup Use the following procedure to change the way spreadsheet data in the Answerset and History window appears and is printed using the Page Setup dialog box. To use the Page Setup dialog box 1 Under File, select Page Setup. 2 Use the Page Setup dialog box to set how the page looks. 3 To see how the page looks, click Print Preview. See also Using Print Preview on page 57Using Print Preview. Table 11: Description of the Page Setup Dialog Box and Print Preview Window Option Margins Orientation Page Size Scale Factor Print in Color Print a border around the data Page Title Description Select the margin size for the spreadsheet. Select the orientation for the spreadsheet. Select the paper size. Scroll or enter a value between 50 and 200 percent for the scale size of the spreadsheet. The default scale size is 100 percent. Select to print in color. The default is to print in black and white. Note: This option is also available when printing a Query or output from Explain and Show statements. Select this option to print a border around the spreadsheet data. This option adds a point border around the speadsheet information. Note: This option is also available when printing a Query or output from Explain and Show statements. Enter a title for the page. Using Print Preview The Print Preview dialog box allows you to preview Answerset or History window spreadsheet data before printing. Print preview is only available from the Answerset window and the History window. These two windows print data in the form of a spreadsheet. You can print the Query window, but print preview is not available. To use the Print Preview window Do one of the following: Select Print Preview under File on the toolbar. To view one or more pages at a time, select. Use to change the view size. Teradata SQL Assistant for Microsoft Windows User Guide, Release

58 Chapter 1: Getting Started Support for Unicode and UTF-8 To print, click. View a different page by using. Support for Unicode and UTF-8 The Teradata data source must be defined to use either a UTF-8 or UTF-16 session character set in order to successfully submit or retrieve Unicode data. CLOBs can not be retrieved over a UTF-8 ODBC connection. CLOBs can be retrieved over a UTF-16 ODBC session if the ODBC option Use native LOB support is selected. If this option is not selected, or if you are working with Teradata Database V2R5.0 or lower, all fixed length character data can be returned with additional blank padding up to a length of double the actual column size. This limitation is caused by insufficient descriptive information returned to the driver from older Teradata Database releases. The following sections contain related information. Displaying Unicode Data Exporting Unicode Data Importing Unicode Data Displaying Unicode Data To display languages such as Arabic or Hebrew, which are normally displayed from right to left, use the Regional Settings option of Windows Control Panel to install the required language support files. Exporting Unicode Data To export to a text file: Importing Unicode Data Select an Export file type of Delimited Text [UTF-8] or Delimited Text [Unicode]. If Delimited Text (ASCII) is selected, any data that is not a part of the code page is corrupted. Note: Teradata CLOBs over 2K in size can only be returned through an ODBC connection if the UTF-16 character set was specified in the Connection dialog box. Imported files can be in ASCII, Unicode (UTF-16), or UTF-8 format. (If Unicode or UTF-8 the file MUST contain the appropriate Byte Order Mark prefix.) When Importing CLOB data, the data files referenced in the Import file can be in ASCII, Unicode (UTF-16), or UTF-8 format. All files destined for a specific column should be of the same type. 58 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

59 Chapter 1: Getting Started Support for the Visually Impaired Support for the Visually Impaired SQL Assistant provides a number of features for the visually impaired: Text Size Color scheme Audible support General Command Shortcut Keys Text Size The General tab of the Options dialog box allows the selection of a Larger or Largest font size. These increase the size of the default font and the dialog boxes themselves by 25% or 50% respectively. In addition, both the font and the font size can be changed in the Query, Answerset and History windows. You can also temporarily increase or decrease the size within these windows by pressing the Ctrl key while spinning the mouse wheel or pressing the +/- keys. Color scheme Audible support The General tab of the Options dialog box allows the selection of the Application style. This controls the colors used throughout the application. If using one of the Windows High Contrast options, select System Default as the application style. The colors used in the Query window are independent of the Application style settings. Change these colors using the Display Item list with the Color control, on the Code Editor tab of the Options dialog. If using a screen reader, select the Provide extended support for screen readers check box on the General tab of the options dialog box. This causes the screen reader to announce the contents of each cell as you move through the cells of an Answerset or History window. For a sound to be played whenever a query ends, select the Provide audible notification when a query ends check box on the Query tab of the options dialog. Limitations The following sections list limitations with Teradata SQL Assistant: General Teradata Limitations Teradata.NET Specific Limitations Oracle.NET Specific Limitations ODBC Specific Limitations Teradata SQL Assistant for Microsoft Windows User Guide, Release

60 Chapter 1: Getting Started Limitations Please refer to the release notes for the latest information. General Teradata Limitations If you submit a Create or Replace Trigger statement it must be the last, or only, statement in the submitted SQL. Teradata.NET Specific Limitations A WITH (summary) clause in a Select statement causes the data return to fail. TD.NET always uses ANSI date mode. All date literals must be entered as YYYY-MM-DD. Timestamp With Time Zone columns only sort correctly if you use a date format of YYYY- MM-DD. Oracle.NET Specific Limitations ODBC Specific Limitations Decimal columns with more than 28 digits might be displayed as <Error>. You must use the correct case for Database/User names (generally Uppercase). This applies to the Connection dialog box, when adding Databases to the Explorer tree, or when enclosing object names within double quotes. Create Procedure statements must end with a semicolon. These statements create, but not compile, the procedure. You must compile the procedure before it can be executed. General Batch Import functionality is not available. The Edit Table function is not available. Time fields do not display fractional seconds or Time Zone information. Decimal values with more than 28 digits might display incorrectly. Retrieving Interval data or vendor specific types might limit the functionality of the resultset as follows: Decimal data might display 'n' decimal places ('n' is the value for Float data in Options). Date columns might be displayed as Timestamps and might not use your selected format. BLOB/CLOB columns might be displayed as regular BYTE/CHAR data. Teradata CLOBs can only be returned using the UTF-16 Session Character Set (unless < 2K). Only type 'F' User Defined Functions are listed in the Database Explorer Tree. FLOAT columns might be reported as 'TIME' in the Database Explorer Tree if they have a Format clause that looks like a time, for example, '99:99:99'. 60 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

61 Chapter 1: Getting Started Limitations If a macro (or execute parallel) returns zero rows from a Select statement, no rows are returned from any later Select statements in that macro or parallel query. The location of Syntax errors are not highlighted. DB2 In order to return BLOBs and CLOBs correctly you must either set LongDataCompat=1 in the db2cli.ini file or use Define ODBC Data Source dialog box to set this option in the Data Source itself. 1 Open the Define ODBC Data Source dialog box and select the data source and click Configure. 2 Click Add on the Advanced tab and select LongDataCompat from the list. 3 Select the As LongVarchar data option. Oracle Procedure and Function parameters are not displayed in the Database Explorer Tree. Retrieval of INTERVAL or other 'unknown' types causes the ODBC driver to crash..net cuts off the first byte when selecting columns defined as RAW(n). This renders the binary object useless. Define the columns as BLOB instead. PostgreSQL Import only works if all columns can be converted to CHAR type. PostgreSQL has no ability to convert a string to a numeric, for example. MySQL You must use MySQL Connect/ODBC , not (Future versions might remove this limitation.) The older 5.1.x ODBC drivers do not return catalog information (tables and columns, for example). Teradata SQL Assistant for Microsoft Windows User Guide, Release

62 Chapter 1: Getting Started Limitations 62 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

63 CHAPTER 2 The Query Window This section explains how to use the Query Window and its features and functions, as well as how to import data. This section contains the following information: Introduction to the Query Window Using the Query Window Entering and Executing Queries Working With SQL Text in the Query Window Displaying an Explain Plan of a Query Query Builder Overview Scheduling Queries for Later Execution Formatting a Query Importing Data Using the Query Window Shortcut Menu Introduction to the Query Window The Query Window is a fully functional editing environment that can be used to edit and execute queries. The following list describes some of the features the editor: Drag-and-drop editing Automatic syntax coloring and brace matching See Setting Code Editor Options on page 69. Suggestion lists and quick function descriptions See Using Code Completion on page 73. Converting of selected text to either upper or lower case See The Query Toolbar on page 168. Inserting or deleting bookmarks See Selecting Text and Inserting Bookmarks Using the Query Window Margin on page 65. Making white space characters visible See The Query Toolbar on page 168 Recording and playing back of keystroke macros See Recording and Executing Query Window Macros on page 82. Teradata SQL Assistant for Microsoft Windows User Guide, Release

64 Chapter 2: The Query Window Using the Query Window A full compliment of command and cursor control shortcut keys See General Command Shortcut Keys on page 179 and Window Control Shortcut Keys on page 183. The results from the query are placed into one or more Answerset windows. Alternatively, the results can be written directly to a file. Queries can consist of one or more statements, and can return zero or more Answersets. Enter SQL, DDL, or DML into the Query Window. Comments can be added to queries. These comments are stored in the history database as part of the query. When the Query Window is active, the menus, commands, and tools available pertain only to that window. Using the Query Window This section explains how to use the Query Window. Topics covered include the following: Using SQL, DDL, and DML Statements Displaying the Query Window Toolbar Allowing Multiple Queries Splitting the Query Window into Two Windows Selecting Text and Inserting Bookmarks Using the Query Window Margin Creating Statements (Single and Multi) Parameterized Queries Magnifying the Query Window Setting Query Options Setting Code Editor Options Using SQL, DDL, and DML Statements The SQL, DDL, and DML statements should conform to the syntax defined with the ODBC or Teradata.NET data sources. Displaying the Query Window Toolbar Use the following procedure to display or hide the Query Window toolbar. To display the Query Window toolbar Do one of the following: Select View > Toolbars > Query. Right-click anywhere in the menubar or toolbar, then select Query on the popup menu. 64 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

65 Chapter 2: The Query Window Using the Query Window Allowing Multiple Queries Teradata SQL Assistant allows you to connect to multiple data sources. Each connection opens a separate Query window. You can also have multiple queries within a Query window. Each query opens a new tab in the Query window. Use the following procedure to open both multiple Query windows and multiple tabs. To allow multiple queries 1 Select Tools > Options and select the General tab. 2 Select one or both of the following options: Allow connections to multiple data sources (Query window) Allow multiple queries per connection (Tabs in the Query window) 3 Click the New Query icon. A new tab opens in the current Query window. 4 Click the Connect... icon to open an additional data source. This opens a new Query window. See Connecting to and Disconnecting from a Data Source on page 30 for more information on data sources. Splitting the Query Window into Two Windows Split the query window into two independent scrolling windows to view two different parts of the query at once. To split the Query Window into two scrolling windows On the right side of the Query Window, drag the bar at the top of the vertical scroll bar downwards. Selecting Text and Inserting Bookmarks Using the Query Window Margin Use the margin at the left of the Query Window to select text and insert or delete bookmarks. To select text and insert or delete bookmarks using the margin of the Query Window To select text and insert and delete bookmarks, do one of the following: Click in the margin to highlight the corresponding line. Click and drag in the margin to highlight multiple lines. Double-click in the margin, press Ctrl+B, or click to toggle a bookmark on or off for that line. Teradata SQL Assistant for Microsoft Windows User Guide, Release

66 Chapter 2: The Query Window Using the Query Window Creating Statements (Single and Multi) Parameterized Queries Queries that consist of one or more statements can be created. A semicolon is not required when one statement at a time is entered. However, a semicolon between the statements is required for two or more statements. Each statement in the query is submitted separately to the database. Therefore, the query can return more than one Answerset. Queries can contain Named Parameters, making it easy to reuse a query because the only changes are the data values (for example, in a Where clause). Named Parameters function like variables. Enter the value for a named parameter once. If it is used in multiple places within the query that same value is used in all places. Note: The values entered for named parameters are saved to the Notes column of History for future reference. Named Parameters are indicated by a? immediately followed by a name. The name can consist of alphanumeric characters plus the _ symbol. When an parameterized query is executed, a prompt appears for each parameter before the query is submitted. For example, if the following query is submitted, Select * From PhoneBook Where LastName Like '?NameStart' a prompt appears to enter a value for NameStart. Parameter values are directly inserted into the query, which means they might need to be enclosed in quotes. Although quotes can be used when prompted for the data value, it is generally recommended that quotes be included in the query itself, as in the above example. See Setting Query Options on page 67 for more information. To switch off parameter substitution 1 Select Tools > Options. 2 Select the Query tab. 3 Clear the option Allow use of Named Parameters in queries. Note: If an empty string is entered, or the Cancel button is used, the query is left unchanged. This allows for those rare cases where SQL Assistant incorrectly identifies a regular part of the query as being a parameter name. Magnifying the Query Window Use the following procedure to change the magnification of a window. 66 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

67 Chapter 2: The Query Window Using the Query Window Setting Query Options To magnify the active window 1 Ensure the window is active. 2 Hold the Ctrl button and rotate the mouse wheel or press the + or - keys. The display zooms in and out. 3 To restore the zoom level to its original size (100%) press Ctrl+0. Use the following procedure to control queries by setting options on the Query tab. Note: The SQL Assistant option Allow use of ODBC SQL Extensions in queries no longer exists. Clear the ODBC Data Source option Disable Parsing to allow the use of ODBC SQL Extensions. To set query options 1 Select Tools > Options. 2 Select the Query tab. Table 12 explains each option in the Query tab. Teradata SQL Assistant for Microsoft Windows User Guide, Release

68 Chapter 2: The Query Window Using the Query Window Table 12: The Query Tab in the Options Dialog Box. Option Close the Answerset window before submitting a new query Disable parsing for Queries larger than Disconnect from database when a query ends Limit parsing for Queries larger than Minimize SQL Assistant while a query is running Prompt for a note before running a query Provide audible notification when a query ends Stop query execution if an SQL error occurs Submit only the selected query text when highlighted Allow use of Named Parameters in queries. Description The default value is selected. When selected, all Answerset windows that are not marked as Do not Close are closed before running a new query. The default is 900 KB. If a query is larger than this size when loaded from a file, or from History, then all parsing will be switched off. The query will display plain text without any highlighting, uppercasing, outlining, or code completion functionality. The default value is cleared. When selected, this option starts and stops the connection to the data source with each query. Note: When using this mode, all transactions must be committed or rolled back within the query that started them. The default is 200 KB. If a query is larger than this size when loaded from a file, or from History, a simpler language definition will be used in order to improve performance. In this case only the more common keywords and functions will be highlighted, and automatic uppercasing will not occur. The default is cleared. When selected, Teradata SQL Assistant minimizes when a query runs. The default is cleared. When selected, Teradata SQL Assistant displays a dialog box to enter notes whenever a query is submitted. Also, on the toolbar click (you can toggle this option on or off). To add a note after the query has completed, double-click the note cell, or click the cell and press Enter. The Query Note dialog box opens. The default is cleared. When selected, Teradata SQL Assistant makes a sound when a query is complete. The sound also occurs if the query times out, the number of rows exceeds the output limit, or the query is canceled. This option is also available from the toolbar by clicking. The default is selected. When selected, queries are stopped if an error occurs even if the query contains additional statements that have not yet been executed. If a query with conditional logic based on the ERRORCODE command is used, clear this option. If this option remains selected, Teradata SQLA stops processing the query before it attempts to evaluate the conditional logic. Queries with conditional logic based on ERRORCODE and ending with an EXIT command are reported as successful if the return code is zero. The default is cleared. This means even if part of the query is highlighted, the entire query is executed when submitted. The default is selected. This setting allows the use of Named Parameter substitution in queries. 68 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

69 Chapter 2: The Query Window Using the Query Window Table 12: The Query Tab in the Options Dialog Box. (continued) Option Prompt to save the Query Log when a Query ends Prompt to save queries that have been changed, but not run, before closing Description The default is cleared. When selected, Teradata SQL Assistant displays a dialog box that allows the Query Log to be saved after a multi-statement query is executed. The default is selected. When selected, Teradata SQL Assistant displays a dialog box to save the Query to either a file or to the History database before closing the Query window or closing Teradata SQL Assistant. A prompt to save the query only displays if changes were made to the query since opening a file, saving to a file, executing the query, copying a query from the History window by clicking on the SQL, or using the Clear Query button. Setting Code Editor Options Queries can be automatically colorized as you type, using the Code Editor tab in the Options dialog box. The query text is colorized based on specific SQL keywords and functions, strings and numbers, comments, and so on. Query syntax and parser errors are highlighted in yellow by default in the Query window. This color can be changed in the Code Editor tab. Teradata SQL Assistant for Microsoft Windows User Guide, Release

70 Chapter 2: The Query Window Using the Query Window To set formatting options for a query 1 Select Tools > Options. 2 Select the Code Editor tab. Table 13: Code Editor Tab in the Options Dialog Box 3 Select an option. The following table explains each option. Note: For more information on how syntax highlighting works, see Language Definition Files on page 96. Note: Japanese object names are only highlighted as object names if they are enclosed in double quotes. Option Automatic syntax highlighting Convert keywords to upper case Display line numbers Display left margin Display brace matches Insert spaces for tabs Indent new lines like previous Wrap lists after Display Quick-Info Tips Display suggestions Include table names Include built-in functions Description Enables syntax highlighting. If this option is not selected, all text is set to the default color. The default is selected. Note: Disabling this feature also turns off automatic brace matching. Displays all keywords in uppercase. The default is cleared. Displays line numbers to the left of each line in the query. The default is cleared. Displays the left margin in the Query window. The default is selected. If this option is selected, keywords (such as BEGIN and END), symbols, parenthesis, and quotation marks are highlighted as a pair when the cursor is placed within or after a keyword. The default is selected. Inserts n space characters each time the tab key is pressed. Use the Tab Size box to indicate the number of spaces for each tab entered, from 2-9. The default is cleared. The default is selected. If this option is not selected, all new lines start at the left margin. When using Format Query, any comma that is found after this column causes the remaining text on that line to be moved to a new line. To format the query so that each column in the select list is on a separate line, set to a low value such as three. The default is 60. When selected, a description of the function will be displayed in a tool tip when you hover the mouse over a function name. The default is cleared. If this option is selected SQL Assistant displays drop down lists containing object and built-in function names. The default is cleared. See Using Code Completion on page 73. This option applies only if Display suggestions is also selected. When selected, both Table and View names are included in the object name lists. When cleared, only Views are included. The default is cleared. This option applies only if Display suggestions is also selected. When selected, built-in function names are included in the suggestion lists. The default is checked. 70 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

71 Chapter 2: The Query Window Entering and Executing Queries Table 13: Code Editor Tab in the Options Dialog Box (continued) Option Display Item Description Shows a list of syntax elements and other application settings. Select an item to see its current color displayed in the Color field to the right. Its font style is indicated by the bold and italicized check boxes below. Change the color by clicking the dropdown button of the Color list and selecting a new color from one of the three tabs: Custom tab Select one of the displayed colors, or right-click in the bottom 2 rows to display the Windows custom color dialog box, which allows you to define your own color. Web tab These are colors commonly found in web pages. System tab Standard System colors. Change the font style by selecting or clearing the two check boxes. Note: The font style options are only available for the query syntax highlighting colors. Entering and Executing Queries This section provides information about the following: Entering a Query Using Conditional Logic in a Query Outlining Using Code Completion Displaying Function Descriptions Inserting Function Templates Customizing Code Completion Lists Executing a Query Using Transactions Running Multiple Queries Executing Multiple Statements in Parallel Submitting Part of a Query Aborting a Query in Progress Executing a Query Saved To a File Automatically Minimizing the Teradata SQL Assistant Window Renaming a Query Tab Deleting a Query Tab Teradata SQL Assistant for Microsoft Windows User Guide, Release

72 Chapter 2: The Query Window Entering and Executing Queries Entering a Query After establishing a connection to a data source (refer to Connecting to and Disconnecting from a Data Source on page 30), Teradata SQL Assistant is ready to execute queries. (Queries can be entered before a connection is established.) To enter a query Do one of the following: Click within the Query Window and enter a statement. On the toolbar click, and enter a statement in the new Query tab. Select File > New Query and enter a statement in the new Query tab. Press Ctrl+N and enter a statement in the new Query tab. From the History window, select any statement from the SQL statement column. The Execute command submits the query currently in the Query Window to the database. Each statement in the query is submitted separately to the database. By default, queries are submitted asynchronously and can be aborted while they are executing. Using Conditional Logic in a Query The following conditional logic commands can be used within queries. Table Legend {} Items in curly brackets are requirements. [ ] Items in square brackets are optional. label A string that does not contain any blank spaces or tabs. oper One of the following operators: = > < >= <= <>!= ^= ~= n An integer. value Any string. filename A fully qualified file name. Command.IF {ACTIVITYCOUNT} oper n [THEN] {.GOTO label} {ERRORCODE } {.EXIT [n] }.GOTO label Description If the condition is true, the action is performed. Otherwise the flow continues to the following statement. This command cannot be used before the first SQL statement. The next statement executed is the statement following the.label command. 72 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

73 Chapter 2: The Query Window Entering and Executing Queries Command.LABEL label [ n ].EXIT [ ERRORCODE ] [ ACTIVITYCO[UNT]].QUIT.SET value.run filename Description Defines the destination of a.goto command. Execution terminates at this command. The optional parameter is used as the result code for the query. Zero indicates a successful query, any other value indicates failure. Performs the same function as the.exit command. This command is for BTEQ compatibility only. This command is ignore. Unlike BTEQ, The.SET prefix is required for Teradata SQL Assistant to recognize and ignore a command. Execute the query contained in the specified filename. The RUN command must be the first and only statement executed. Usage Notes The period (.) before the RUN command is optional for backward compatibility. The period (.) before other commands (except.set) is optional when connected to a Teradata Database, but required when connected to other databases. The period for the.set command is mandatory even when connected to a Teradata Database. [Optional] All commands can be followed by a semi-colon. This is not required unless you need compatibility with BTEQ. To use conditional logic commands based on the ERRORCODE, you must first disable the Stop query execution if an SQL error occurs option on the Query tab of the Options dialog box. Otherwise Teradata SQL Assistant might stop processing the query before it attempts to evaluate your conditional logic. See Setting Query Options on page 67. Outlining This feature allows you to collapse a derived table or Case clause in order to more easily understand the surrounding code. Entire statements, Begin/End blocks and procedural blocks (IF, LOOP, etc.) can also be collapsed. Using Code Completion To Expand or Collapse a block Do one of the following: Click the + or - symbol in the left margin. Select View > Toggle Outlining. Press CTRL-K. SQL Assistant can provide suggestions for the object and built-in function names that can be used. Teradata SQL Assistant for Microsoft Windows User Guide, Release

74 Chapter 2: The Query Window Entering and Executing Queries A drop down list might appear after you type any of the following delimiter characters: space, comma, tab,, arithmetic symbols, or comparison symbols. As you continue to enter the object name, the first item to match is selected in this list. When the item you want is selected, type one of the delimiter characters or press Enter to select and insert that name into your query. You can type an open parenthesis to accept and insert any function name that requires parenthesis. Only an open parenthesis or the Enter key will accept and insert such a function. You can close the list by pressing ESC. Code completion only appears after the keywords and delimeters used within the common Select, Insert, Update and Delete statements are typed, and after the space following Create, Alter, Drop, Modify, Replace, Show, Help and Database keywords. To display a selection list when you have not typed one of the delimiter characters, press Ctrl+Space. Code completion works differently in SQL Assistant than it does in other editors. SQL Assistant uses the concept of a current database. Initially the current database is set to the default database for the data source. Change this setting by right clicking on a database in the Database Explorer tree and clicking the Use for View Names menu. When the FROM clause is entered, the suggestion list contains all the views, and (optionally) the tables, in the current database in addition to all the databases currently in the Database Explorer tree under this data source. SQL Assistant also builds an active list. Each time table or view name in the FROM clause is entered, that object along with any alias name is added to the active list. When entering the Select and Where clauses, these alias names and the columns contained in the objects within the active list appear. Because objects and their columns are not added to the active list until they have been entered in the FROM clause, type thefrom clause before the remainder of the statement. The active list continues to grow as additional Select statements or sub-selects are entered. This means that you do not need to enter the FROM clause of your second statement before other parts of the statement if your previous statements referenced the same tables. However, if you switch to a completely different set of tables and views, reduce the size of the dropdown lists by clearing out the active list by right clicking on the data source in the Database Explorer tree and selecting the Clear Column List menu. Note: If you use the Teradata form of the FROM clause (a simple comma separated list), the last name in the list is not be added to the active list unless you press Ctrl+Shift+Space after the last View/alias name or type the start of the Where clause. To Display suggestion lists 1 Select Tools > Options. 2 Select the Code Editor tab. 3 Select Display Suggestions. 74 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

75 Chapter 2: The Query Window Entering and Executing Queries 4 [Optional] Select Include Table names. Only Views are listed if this option is cleared. 5 [Optional] Select Include built-in functions Note: Selecting the Display suggestions option automatically switches on the DB Tree option Save Database Tree information to disk and reload it at startup. To avoid serious performance impact when the Tables or Views node of a database is expanded, select the DB Tree option Load only column names for Views. Displaying Function Descriptions Position the mouse so that the cursor is over a function name to display a description of that function in a tool tip. The description displays the parameters required by that function and a brief description of its purpose. Square brackets [] are used to indicate optional parameters, while braces {} are used to indicate alternative values for a required parameter. A vertical bar is used between alternative options. To Display function descriptions 1 Select Tools > Options. 2 Select the Code Editor tab. 3 Select Display Quick-Info tips. Inserting Function Templates When the parameters required by a function are complex, you can insert the parameter template by double-clicking on the function name. Scalar and Aggregate functions are too simple for this feature to be useful, but the feature is available for the more complex Table Functions, and Table Operators, such as NPATH. Customizing Code Completion Lists The list of built-in functions that appear in the code completion drop down lists is vendor specific. Currently only four sets of lists are provided: Teradata Base ANSI ANSI2008 The ANSI file is used when View > ANSI SQL is selected and you are connected to Teradata. The Base and ANSI2008 files are used when you are connected to a non-teradata Database. These lists are defined in files named TeradataXX.mbr, BaseXX.mbr and so on. Where XX is AF for aggregate functions, NF for regular functions, TF for table functions, or TO for table Teradata SQL Assistant for Microsoft Windows User Guide, Release

76 Chapter 2: The Query Window Entering and Executing Queries Executing a Query operators. The.mbr files are located in \Users\<user>\AppData\Roaming\Teradata\SQL Assistant. If you regularly work with another database such as Oracle, you can create your own lists specifically for use with that database type (for example, OracleNF.mbr and OracleAF.mbr). You can also edit the existing.mbr files to remove unused functions or add your own User Defined Functions (UDFs). These are simple XML text files containing a single element type with 4 attributes: name is the text that appears in the dropdown list. help is an optional string that appears in a tooltip when the list item is selected. hasparen is an optional attribute that should be set to false if no parens are required. db is an optional attribute that can be specified to add a database prefix to the name. Note: Certain characters must use their html equivalent: > [>] < [<] and ["] The following special characters are used within the help text: ~ Must immediately precede the function name! Must immediately follow the function Is used to insert a line break for the Quick-Info tool tip Can be used after the final close paren at the end of the parameter list. This is intended for complex functions with many parameters. It will activate the functionality to insert the parameter template into the Query when you double click the function name. To execute a query Do one of the following: On the toolbar click. Select Tools > Execute. From the Query Window, right-click and select Execute. Press F5. Results from the query appear in one or more Answerset windows. When you submit a query the background color of the tab and the part of the query that you executed change to the Query is Running color (default pale orange), and the part that you executed is protected. You will not be able to change this protected text but will be able to edit other parts of the query. The current status is shown on a Query Status Bar that appears at the bottom of the Query window. If the query contains more than one statement, it is replaced by a log that shows the progress of the query. In this case, a button appears at the far right of the query status bar, below the Query window, that allows you to toggle the display between the log and the query itself. 76 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

77 Chapter 2: The Query Window Entering and Executing Queries Using Transactions When a query completes, if the executing tab is the active tab, the background color reverts to its default color. If another tab is active, the background color changes to green to indicate that the query in that tab has ended. In this case the color reverts to its default color when you click on the tab. In most cases, use the vendor provided statements for Beginning, Committing, or Rolling back transactions. If you are using ANSI Transaction mode with Teradata, the data connectivity tools autocommit each statement. In order to create transactions in this mode, use the following SQL Assistant specific commands: Command.BeginTx.CommitTx.RollbackTx Usage Starts a transaction Commits the transaction Rolls back all changes made within the transaction If you attempt to disconnect or close the Query window while a transaction is in progress, it asks whether the transaction should be committed or rolled back. Note: Do not execute multiple queries at the same time within a single Query window while using transactions, unless the entire transaction is contained within a single query, because multiple queries execute within different sessions and there is no way to control which session executes which query. Running Multiple Queries Multiple queries can run at the same time, either from multiple tabs within one Query window or from multiple Query windows. Each Query is executed in its own thread and has limited impact on other concurrently running queries or on the user interface. Note: If you run multiple queries from different tabs within the same Query window, SQL Assistant temporarily connects additional sessions using the same connection information you entered for the initial connection. No special context is available to these additional sessions, however, so do not assume that the default database (if you have changed it) or temporary tables are available. If your queries rely on the default database, or on the existence of temporary tables, you should execute/run only one query at a time from within a specific Query window. This ensures that each query uses the same session that was used by the previous query. Executing Multiple Statements in Parallel Executing multiple statements from the Query Window to the database Using the Execute Parallel command. This executes the entire query as a single request, allowing the database to Teradata SQL Assistant for Microsoft Windows User Guide, Release

78 Chapter 2: The Query Window Entering and Executing Queries execute all the statements in parallel. Multiple Answersets can be returned in the Answerset window. Note: To submit a Transact-SQL script containing semicolons to a Microsoft SQL Server or Sybase database, use the Execute Parallel command. To execute statements in parallel 1 Enter multiple statements in the Query Window. 2 Do one of the following: Select Tools > Execute Parallel. On the toolbar click. Press F9 Submitting Part of a Query To submit any part of any query 1 Select Tools > Options. 2 Select the Query tab. 3 Select the option Submit only the selected Query text, when highlighted. 4 From the Query Window, select part of the query by highlighting it. 5 Do one of the following: On the toolbar, click. Press F5. Note: While the query is executing, only the part of the query that you executed has a red background and is read only. To submit the first part of a multistatement query Insert an EXIT statement within the query by inserting the word EXIT following the semicolon that ends the last statement to process. Note: The word EXIT must be the next non-whitespace/non-comment text after the semicolon that ends the last part of the query being submitted. It must also be on a new line, and can be preceded by whitespace. Aborting a Query in Progress When the query is submitted, the Abort menu and tool button are enabled so that the query can be aborted if necessary. If performing a task that loads objects into the Database Explorer Tree, this task can also be aborted. 78 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

79 Chapter 2: The Query Window Entering and Executing Queries To abort a query in progress Do one of the following: Select Tools > Abort. On the toolbar, click. If a SELECT statement is aborted before all rows are returned, the number of rows reported is the total number of rows matching the query rather than the actual number returned before the abort. This applies only to databases, such as Teradata, that provide this information. Executing a Query Saved To a File To simplify the use of large queries and for those who store their queries in a file, enter the following query where <filename> is the fully qualified name of a file containing the query to execute. RUN <filename> For example, RUN c:\temp\myquery.sql The run statement must be the only statement in the Query Window. A filename can be followed by a semicolon. All text between the word RUN and the optional semicolon are assumed to be a part of the file name. The query is processed exactly as though it had been entered in the Query Window, but the SQL stored in the history file is the run statement itself, not the actual query that was executed. Automatically Minimizing the Teradata SQL Assistant Window Use the following procedure to automatically minimize the Teradata SQL Assistant window when a query is being processed. Renaming a Query Tab To automatically minimize the Teradata SQL Assistant window 1 Right-click in the Query Window. 2 Click Minimize on Execution. The Teradata SQL Assistant window minimizes when the query is being processed. This command remains in effect until Minimize on Execution is clicked again to cancel it. Use the following procedure to change the name of each tab when Query windows appear in tabs. Teradata SQL Assistant for Microsoft Windows User Guide, Release

80 Chapter 2: The Query Window Working With SQL Text in the Query Window Deleting a Query Tab To rename a Query tab 1 Right-click on the query tab and select Rename from the displayed popup menu. 2 Enter a new name. Use the following procedure to delete individual tabs and their contents when queries appear in tabs. To delete a Query tab Right-click on the tab and select Delete from the displayed popup menu. Working With SQL Text in the Query Window This section provides the following information about working with SQL text in the Query Window: Copying SQL from Previous History Record to the Query Window Copying SQL from Next History Record to the Query Window Preventing Queries from Being Saved in the History Window Undoing or Redoing Query Window Changes Setting Repeat Count Recording and Executing Query Window Macros Saving a Query Performing a Quick Save Adding a Query to Favorites Opening a Query from a File Copying a Query to Notepad Printing a Query Adding Comments to Queries Highlighting a block of Text Showing Whitespace Converting Tabs to Spaces Indenting Lines in a Query Using the Right-to-Left Editor for Queries Deleting Blank Lines from a Query Finding a Text String in the Query Window Replacing a Text String in the Query Window 80 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

81 Chapter 2: The Query Window Working With SQL Text in the Query Window Copying SQL from Previous History Record to the Query Window Use the following procedure to copy SQL from the previous History record to the Query Window. To copy the SQL from the previous row Do one of the following: Select View > Previous SQL. Press F7. The history SQL either replaces what was previously in the current Query tab or appears in a new Query tab if the query had been changed. Copying SQL from Next History Record to the Query Window Use the following procedure to copy SQL from the next History record to the Query Window. To copy the SQL from the next history row Do one of the following: From the View menu, select Next SQL. Press F8. The history SQL either replaces what was previously in the current Query tab or appears in a new Query tab if the query had been changed. Preventing Queries from Being Saved in the History Window Queries are normally inserted into the History window and the supporting Microsoft Access table for later recall and use. If you do not want the History window updated with each query, you can change the option. To prevent queries from being saved in the history window 1 Select Tool > Options. 2 Select the History tab. 3 Clear the option record queries and metadata in the History Database. Undoing or Redoing Query Window Changes You can undo or redo the changes made in the Query Window. To undo or redo a change in the Query Window Select Edit > Undo (Ctrl-Z) or Edit > Redo (Ctrl-Y). Teradata SQL Assistant for Microsoft Windows User Guide, Release

82 Chapter 2: The Query Window Working With SQL Text in the Query Window Setting Repeat Count Keystrokes, macros, and shortcut keys can be set to repeat n times in a query. To set repeat count 1 Press Ctrl+R, or click on the Query Window toolbar. For more information, see Displaying the Query Window Toolbar on page 64. The Set Repeat Count dialog box displays. 2 Enter the number of times to repeat the selected keystrokes, shortcut keys or macros. Recording and Executing Query Window Macros To simplify repetitive tasks you can record macros containing multiple keystrokes, then play back these macros at any time in the Query Window. To record a Query Window macro 1 Press Ctrl+M or click on the Query Window toolbar. For more information, see Displaying the Query Window Toolbar on page 64. The toolbar button changes to the Stop Recording icon and a Recording... message is displayed on the Status bar. 2 Enter the desired keystrokes, including text and shortcuts. 3 When finished, press Ctrl+M again, or click on the toolbar to halt recording. The Get Macro Name window appears. 4 Enter the name you want to use for this macro and press OK. To select and play back a Query Window macro 1 Click to display the Keyboard Macros dialog. 2 Select the macro to play from the list of available macros. 3 (Optional) Enter the number of times you wish the macro to be played. Note: The default is 1. 4 Click Play or press Enter. To replay the most recently played Query Window macro Click or press Ctrl+E. 82 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

83 Chapter 2: The Query Window Working With SQL Text in the Query Window To delete Query Window macros 1 Click or press Ctrl+E to display the Keyboard Macros dialog. 2 Select the macro(s) you wish to delete from the list of available macros. 3 Click Delete Saving a Query There are three ways to save queries in Teradata SQL Assistant, the basic Save, Save As, and a Quick Save. The following procedure explains Save and Save As. See also Performing a Quick Save. To save a query 1 From an active Query Window, do one of the following: Select File > Save As Select File > Save Click or. Press Ctrl+S 2 In the Save Query dialog box, enter a file name. 3 From the Save As Type menu, select the file type: SQL (.sql) definitions (.ddl) text (.txt) rich text format (.rtf) Unicode Text (.txt) Note: The file types listed in the Save Query dialog box are only suggestions. If you want Teradata SQL Assistant to automatically launch when you double-click the file, select either the.sql or.ddl file type. To store the colors as well as the text so it can be viewed by most word processing applications, select the.rtf file type. 4 Select a location, and click Save. Performing a Quick Save A Quick Save is enabled once a query has been previously saved. The Ctrl+S and Save tool button both activate a Quick Save. During a Quick Save, you are not prompted to select a file name if that query tab has already been saved before. However, using the Save As menu always prompts you for a file name. If you have not saved the query tab before (or have clicked the Clear Query button since the last Save), you are prompted for a file name even if you click Save or press Ctrl+S. Teradata SQL Assistant for Microsoft Windows User Guide, Release

84 Chapter 2: The Query Window Working With SQL Text in the Query Window Adding a Query to Favorites You can add the current query or selected text to a Favorites collection. Once the query is added as a favorite, it can be selected for reuse from the Query Builder window. To add a query to favorites 1 From the Query Window, do one of the following: Right-click over the query to display the shortcut menu, then select Add to Favorites. Click. 2 The Add to Favorites dialog box displays. 3 Select or enter the name of the SQL Set to which you want to add this query. The default SQL Set is Favorites. 4 Enter an item name in the Item Name field. Opening a Query from a File You can open a query that was previously saved to a file. The file can be in ASCII, UTF-8, RTF or Unicode format. To open a query from a file 1 Do one of the following: Select File > Open Query. On the toolbar, click. Press Ctrl+O. 2 Browse your drive and select the file. 3 Do one of the following: Click Open. The contents of the file are inserted into the Query Window. Select File > Open Recent Query, then click on the file that contains your query. Note: As a one-step alternative, drag and drop the file from File Manager or Windows Explorer into the Query window. Copying a Query to Notepad You can copy a specific part of a query or the entire query to Notepad by using the Copy to Notepad command. This command starts the Notepad application and copies the query. 84 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

85 Chapter 2: The Query Window Working With SQL Text in the Query Window To copy a specific part of a query 1 From the Query Window, highlight the specific part of the query you want to copy. 2 Do one of the following: Select File > Copy to Notepad. On the toolbar, click. If you do not highlight any part of the query, the entire query is copied to Notepad. Printing a Query You can print a query in the Query Window using the Windows Print dialog box. To print a query 1 From the active Query Window, do one of the following: On the toolbar, click. Select File > Print Query. Press Ctrl+P. The standard Windows Print dialog box appears. Printers are configured through this Print dialog box. 2 Select from the following: To print the entire query, under Print Range, select All. To print a partial query, go to the Query Window and highlight the part you want to print, then, under Print Range, select Selection. Cancel print jobs through the Print Manager. For more information, see Cancelling Print Jobs on page 117. Adding Comments to Queries Comments can span multiple lines but cannot be nested inside one another. Comments are stored in the history database as part of the query. To add comments to your queries For single-line comments, precede the comment with 2 dashes (--). For multiple-line comments, precede the comment with a forward slash and asterisk (/*), and follow the comment with an asterisk and forward slash (*/). Teradata SQL Assistant for Microsoft Windows User Guide, Release

86 Chapter 2: The Query Window Working With SQL Text in the Query Window To temporarily comment out some of your SQL query 1 Highlight the code you want to comment out. 2 On the Query Window toolbar, click or press Ctrl+/ to comment out the highlighted text. Note: If you select a comment, clicking on the icon removes the comment delimiter from around the selected comment, restoring the contents as part of the query. Highlighting a block of Text This function can only be used when the cursor is positioned within a logical block of text, like between parentheses or within a CASE statement. Showing Whitespace To highlight a block of Text Click to select a logical block of text. Use to following procedure to show the whitespace in the query using the Show Whitespace button on the query toolbar. When whitespace appears, space characters are shown as a single dot and tab characters appear as two chevrons. To show whitespace in a query Click to show the whitespace in a query. Click again to turn off whitespace. Converting Tabs to Spaces The Tabs-to-Spaces button converts tabs already in a query to spaces. To convert tabs into spaces Click button on the Query toolbar. Indenting Lines in a Query Use the Indent buttons on the Query Toolbar to indent lines in a query. 86 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

87 Chapter 2: The Query Window Working With SQL Text in the Query Window To indent lines in a query 1 Place the cursor in the line to be indented or highlight multiple lines. 2 Click or press Ctrl-I to indent the line(s) to the right. 3 Click or press Shift-Ctrl-I to indent the line(s) to the left. Note: If multiple lines are selected, you can use the Tab key to perform step 2. You can also use the Shift-Tab key to perform step 3. Using the Right-to-Left Editor for Queries The Right-to-Left edit box allows you to create queries using right-to-left languages such as Hebrew or Arabic. To use the right-to-left editor 1 On the toolbar, click Edit> Right-to-Left. The Right-to-Left Editor window opens. 2 Enter the query and click OK. The query appears in the Query window. Deleting Blank Lines from a Query To delete blank lines from a query, use the Delete blank Lines button on the query toolbar. To delete black space in a query 1 Highlight the range of lines from which you want to remove blank lines. 2 Click the button. Note: To remove all blank lines in the query, use Ctrl+A to select the entire query before clicking the button. Finding a Text String in the Query Window You can find specific text strings in the Query Window using the Find dialog. You may search for strings using regular expressions or wildcard characters in addition to specific text. To find text in the Query Window 1 With the Query Window active, do one of the following: On the toolbar, click. Select Edit > Find from the menu bar. Press Ctrl+F. Teradata SQL Assistant for Microsoft Windows User Guide, Release

88 Chapter 2: The Query Window Working With SQL Text in the Query Window 2 Enter the desired text string in the Find what field. If you want to build a regular expression, you can access predefined strings by clicking the solid arrow to the right of this field and selecting the expression you want inserted. 3 Select from the following options: Search Whole word only finds text only where a whole word matches the search string Match case finds text that only matches the case of the search string Search selected text only restricts the search to the currently selected block Search hidden text searches within hidden [collapsed] text also Use Regular Expression searches for strings that match a regular expression Note: Most modern regex flavors support a variant of the regular expression syntax called free-spacing mode. This mode allows for regular expressions that are much easier for people to read. In free-spacing mode, whitespace [spaces and tabs] between regular expression tokens is ignored. White space will not be ignored within tokens however, so \ d is not the same as \d, and white space within square brackets is not ignored. If you need to search for a space and/or tab use one of \s, [ ], \x20, \x09. Use Wildcards allows the use of wildcard characters:? any single character * any number of characters # any single digit [xyz] any one character in the set [!xyz] any one character not in the set 4 Specify the search direction by selecting Direction up or down. 5 Click Find Next to locate the string. To locate consecutive strings, click Find Next or press F3. 6 Click Mark All if you want to place a bookmark on each line containing the search string. 7 Click Close to close the dialog. Replacing a Text String in the Query Window Replace any text string in the Query Window with another. To replace text in the Query Window 1 With the Query Window active, do one of the following: From the Query Window toolbar, click. Select Edit > Replace from the menu bar. Press Ctrl+H. 2 Enter the desired text string in the Find what field. If you want to build a regular expression, you can access predefined strings by clicking the solid arrow to the right of this field and selecting the expression you want inserted. 3 Enter the desired replacement text string in the Replace with field. 88 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

89 Chapter 2: The Query Window Displaying an Explain Plan of a Query 4 Select from the following: Whole word only finds text only where the whole word matches the search string Match case finds text that only matches the case of the search string Search selected text only restricts the search to the currently selected block Search hidden text searches within hidden [collapsed] text also Regular Expression searches for strings that match a regular expression Use Wildcards Allows the use of wildcard characters:? any single character * any number of characters # any single digit [xyz] any one character in the set [!xyz] any one character not in the set 5 Select from the following: Click Find Next to find and select the string. Click Replace to replace the found string, or to find the next matching string if the string has not yet been found. Click Replace All to replace all strings matching the find criteria. 6 Click Close to close the dialog. Displaying an Explain Plan of a Query This section provides information about displaying EXPLAIN plans of queries: Displaying a Visual EXPLAIN Plan Displaying a Textual EXPLAIN Plan Displaying a Visual EXPLAIN Plan You can display a visual EXPLAIN of a single-statement query currently in the Query Window. This menu command appears if: You have the Teradata Visual Explain application (version 3.0 or later) installed on your PC, and If you are connected to a Teradata Database To display a Visual EXPLAIN plan 1 Select Tools > Visual Explain. 2 In the Visual Explain dialog box, enter the name of the Query Capture Database (QCD) and click OK. Teradata SQL Assistant for Microsoft Windows User Guide, Release

90 Chapter 2: The Query Window Displaying an Explain Plan of a Query Note: It takes a few moments for the Insert Explain statement to execute, and you cannot continue using SQL Assistant until Visual Explain is launched. To set up a QCD, refer to the Teradata Visual Explain User Guide. Displaying a Textual EXPLAIN Plan You can run an Explain function on the SQL statements in the Query window and display the results in the Answerset window. Teradata SQL Assistant displays the steps that would be executed if you were to actually run the query. To issue a Textual EXPLAIN for a whole query Do one of the following: Select Tools > Explain. Press F6. The explanation appears in the Answerset window. Example The explanation below is returned for the following statement: sel * from dbc.sessioninfo To issue a Textual EXPLAIN for part of a query 1 Select Tools > Options. 2 Select the Query tab 3 Select the option Submit only the selected Query text, when highlighted. 4 Highlight part of a query that you want explained (the highlighted portion must be a valid SQL statement). 5 Select Tools > Explain. The query explanation appears in the Answerset window. 90 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

91 Chapter 2: The Query Window Query Builder Overview Query Builder Overview Query Builder is a tool that helps you create statements to add to the Query window. This section contains information on the following: SQL Statements Procedure Builder <User Defined> Using Query Builder Supported Databases for Query Builder Creating Custom SQL Sets 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. The syntax file name matches the database type with a file type of.syn. For example, the Teradata syntax file is Teradata.syn. Procedure Builder <User Defined> SQL examples are quick and easy to use. In many cases, using these statements eliminates the need for the database manual. Syntax is provided in working form, not syntax notation, for ease of use. Select a statement that best fits your requirements and insert it into the Query Window. You can then tailor it to your needs. These syntax examples reflect the SQL syntax of the data source you are currently connected to. If you are not connected to any server, syntax is based on the server you were most recently connected to. If you have not connected to any server during the current Teradata SQL Assistant session, you get Teradata syntax by default. Procedure Builder provides a list of valid statements used to build the logic of a stored procedure. Vendor specific syntax is available for many databases. If specific syntax is not available for or does not apply to the database, a message indicates the problem. Query Builder allows you to create your own SQL Sets through the <User Defined> option. 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 information on creating a custom file, see Creating Custom SQL Sets on page 94. Using Query Builder Using Query Builder is an easy and convenient to build SQL statements in the Query window. Teradata SQL Assistant for Microsoft Windows User Guide, Release

92 Chapter 2: The Query Window Query Builder Overview To use Query Builder 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 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

93 Chapter 2: The Query Window Query Builder Overview Table 14: Query Builder Statements Option SQL Statements Procedure Builder <User Defined> Description 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 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. 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. Supported Databases for Query Builder Syntax examples are currently provided for the following types of databases: Teradata DB2 Informix Microsoft Access Microsoft SQL Server MySQL Oracle Sybase HP Neoview Ingress PostgresSQL Netezza Teradata SQL Assistant for Microsoft Windows User Guide, Release

94 Chapter 2: The Query Window Query Builder Overview IBM SolidDB Creating Custom SQL Sets Query Builder lets you create custom SQL Sets. To create a custom SQL Sets 1 Open Query Builder, Help > Query Guilder. 2 Click the New SQL Set button. 3 In the dialog box that appears, enter a name for this new SQL Set and click OK. The new name appears in the drop down box. 4 Click the Add SQL button. 5 In the dialog box that appears, enter a name for the new Example, Query, or Snippit, and click OK. 6 In the right pane, enter the SQL for the Example, Query, or Snippit. 7 Click the Save button to save the SQL set. All SQL sets created and saved appear on the drop down menu. The following table explains each icon in Query Builder. Table 15: Query Builder Icon Descriptions and Right-Click Options Icon or menu Description Click the New SQL Set (Ctrl+N) icon to create a new list of statements. Enter the set name in the dialog box that appears. This name then appears in the drop down list. Click the Save SQL Set (Ctrl+S) icon to save changes to the current SQL set. Delete SQL Set (Ctrl+D) Deletes the current SQL set. Confirm your deletion request when prompted. Click the Add SQL (Insert) icon to add a new item to the list in the current SQL Set. This option is also available by right-clicking a statement. Click the Delete SQL icon to delete the current list item from the current SQL Set. This option is also available by right-clicking a statement. Insert into query (Ctrl+I) Replace query (Ctrl+R) Copy to clipboard (Ctrl+C) Inserts the statement into the active Query window. Inserts the selected statement in the active Query window by replacing the existing statement. Copies the selected statement to the clipboard. 94 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

95 Chapter 2: The Query Window Scheduling Queries for Later Execution Table 15: Query Builder Icon Descriptions and Right-Click Options (continued) Icon or menu Show Syntax Rename SQL (Ctrl+H) Description Displays the full syntax of the selected statement. This menu only appears when you are connected to a Teradata Database and have selected the SQL Statements item from the dropdown list. Changes the name of the selected statement. Scheduling Queries for Later Execution Before Scheduling Queries Scheduling Queries You can schedule a query that appears in the Query Window to run at a later time using Teradata Query Scheduler. Requests issued by Teradata SQL Assistant that are restricted by Teradata Workload Management at the current time can be scheduled for later execution, subject to any other scheduled request limitations. For this feature to be available, you must install the Teradata Query Scheduler client software on your PC. For more information, see the Teradata Tools and Utilities Installation Guide for Microsoft Windows. To schedule queries for later execution 1 Select Tools > Schedule. Teradata Query Scheduler launches and the Submit Scheduled Request dialog box opens. 2 Schedule and submit your query. For more information, see the Teradata Query Scheduler User Guide (B ). Formatting a Query The query formatting feature adds line breaks and indentation before certain keywords, making SQL that comes from automatic code generators or other sources more readable. Teradata SQL Assistant for Microsoft Windows User Guide, Release

96 Chapter 2: The Query Window Formatting a Query To format a query 1 Ensure a statement exists in the Query Window. 2 Do one of the following: On the toolbar, click. Right-click in the Query Window, then click Format Query Press Ctrl+Q Select Edit > Format Query Note: Some keywords cause a line break and possibly cause the new line to be indented. If a keyword is found to already be the first word on a line and it is already prefixed by a tab character, its indentation level does not change. Related Topics Indentation Language Definition Files Indentation When you press the Enter key, the new line might automatically indent to the same level as the line above. This is controlled by the Indent new lines like previous option on the Code Editor tab of the Options screen. If you highlight one or more lines in the query and press the Tab key, those lines are indented one level. If you press Shift+Tab, the highlighted lines are unindented by one level. This indentation of lines only applies if the selected text includes a line feed character. For example, you must either select at least part of two lines or if selecting only one line, the cursor must be at the beginning of the next line. Note: This is always the case when you use the margin to select a line. If no line end is included in the selected text, or no text is selected, a tab character is simply inserted. If you wish to indent or un-indent a line without selecting it press Ctrl+I or Shift+Ctrl+I respectively. Language Definition Files Syntax highlighting is based on language definition files (*.lng). These files are automatically installed when you install or upgrade Teradata SQL Assistant and are located in: c:\program Files\Teradata\Client\15.10\bin There is a corresponding language file for each database type. The file name is the SQLType attribute defined in thevendors.config file for that database vendor, with.lng appended. (For unknown database types it uses the SQL Type reported by ODBC.) The appropriate language file is loaded when you connect to a database. If you are not connected to a database, Teradata SQL Assistant loads the previously used language file. 96 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

97 Chapter 2: The Query Window Importing Data Note: The first time Teradata SQL Assistant is started, it uses the Teradata language file. The BASE language file contains the most commonly used definitions found in most SQL languages. This file is the default that is used if you connect to a database type that Teradata SQL Assistant does not recognize. If you plan to work with an unknown database frequently, you can make a copy of the BASE file and save it with an appropriate name to match this unknown database. You can then modify it to match the syntax and keywords used by that language. In addition to the vendor specific files, there are ANSI language files that defines the ANSI 2008 SQL language. Select View > ANSI SQL if you want to switch the syntax highlighting to ANSI mode. If you are connected to Teradata this will use the ANSI language file which supports ANSI compatible Teradata syntax. Otherwise it will use the ANSI2008 file which is a full implementation of the ANSI 2008 specification without regard to whether the vendor supports those statements or keywords. The language files generally define the complete language. A DBA can, however, modify the files to suit the site requirements. The most useful changes to language files would be: Adding a keyword that is not defined in the file Matching an optional database setting. (For example, some databases have a switch to define the use of double quotes. If the language file says that these double quotes define Quoted Names, but you have the option set to allow them to act as string delimeters, you could modify the file accordingly.) Preventing users from submitting certain types of statements. Teradata SQL Assistant declares a statement invalid if the primary keyword (generally the first keyword in the statement) is not found in the MainKeywords, BeginTrans or EndTrans lists. (For example, you can prevent users from executing a DROP statement by moving the DROP keyword from the MainKeywords list to the NewLineKeywords list.) Note: Any user with administrative rights can however reverse the changes made to these files, so this can not be used as a security feature. Importing Data This section provides information about importing data in queries: Before You Begin Importing Data from a File Exiting from Import Mode Types of Import Operations Import Rules Defining the Null Value for an Import Operation Generating Multiple Reports From a Single Query Teradata SQL Assistant for Microsoft Windows User Guide, Release

98 Chapter 2: The Query Window Importing Data Before You Begin The data values required in a query are normally entered as part of the query. The import mode allows you to enter a query containing one or more parameter markers. The data to be used in place of these parameter markers is read from a delimited text file. The query is submitted one time for every record in this input file. The entire query or selected portion is submitted as a single request. What types of statements you can issue You can issue any SQL, Data Manipulation Language (DML) or Data Definition Language (DDL) statement containing one or more placeholders. The statement is executed one time for each record in the supplied import file. The placeholders are replaced with data values in the corresponding record of the file. Note: DML usually refers to INSERT, UPDATE, or DELETE statements. DDL statement usually refers to CREATE, DROP, ALTER, SHOW, HELP, and other statements. What type of files you can import The import file can be any delimited text file containing the correct number of data values in each record. You can create such a file from a query, using a text editor, or by saving spreadsheet data in a delimited text format. Skipping the First Line (Header) of Imported files If the file you are importing contains headers, you can skip the header record by doing the following. To skip the header record of an imported file 1 Select Tools > Options. 2 Select the Import tab. 3 Select the option Ignore the first record in the file (Skip Header). Importing Data from a File To import data from a file 1 Before running a query, set the import mode by selecting File > Import Data. 2 Enter a statement in the Query window. 3 Execute the statement by clicking on the toolbar. 4 When the Teradata SQL Assistant Import File dialog box appears, select a file to import and click Open. 98 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

99 Chapter 2: The Query Window Importing Data Exiting from Import Mode The import mode remains in effect until you turn it off. You can exit from import mode and submit regular queries. To exit import mode Types of Import Operations Select File > Import Data, making sure that the option is cleared. There are three types of import operations: Type 1: Parameterized Import This form applies to CALL, EXECUTE, SELECT, INSERT, UPDATE, and DELETE statements only (with Microsoft Access, this form is used for INSERT only.) The parameter markers can only be used in place of data values and must not be enclosed in quotes. There are four types of parameter markers in this case:? The data for this parameter is read from the Import file. It is always a character string, and converts to a numeric value if necessary.?? The data for this parameter is read from the Import file. It should contain a Hexadecimal string which can contain dashes between each byte value. For example: 414B43 or 41-4B-43.?B The data for this parameter resides in a file that is in the same directory as the Import file. The import file contains only the name of the file to be imported. The contents of the file are loaded as a binary image.?c The data for this parameter resides in a file that is in the same directory as the import file. The import file contains only the name of the file to be imported. Use this marker to load a text file into a CHAR or CLOB column. For example: Insert Into TestTbl Values (?,?,, 'Const',??,?B,?C) In the example above: The table must have a total of seven columns A NULL character is inserted in column 3 for all rows The word 'Const' is inserted in column 4 for all rows The?,??,?B,?C characters are the parameter markers The import file must have five data values per record The 3rd parameter must be a hexadecimal string The 4th parameter must be the name of a binary data file in the same directory The 5th parameter must be the name of a text file in the same directory Teradata SQL Assistant for Microsoft Windows User Guide, Release

100 Chapter 2: The Query Window Importing Data Type 2: Direct Substitution This form applies to all other statements. Parameter markers can be used anywhere in the query. The data values are directly edited into the SQL at the parameter positions. Therefore, some parameter markers might need to be enclosed in quotes. Create User? As Perm=0 Password=? Account=? Note: In Direct Substitution, only the? parameter is valid. If an IMPORT statement returns data, the results are written to a file whose name is formed by adding.log to the end of the import file name. If this file already exists, its contents are replaced with new results. A header record containing the first data value from the corresponding import record is written before each set of returned data. Type 3: Batch This form applies when the following conditions are met: Teradata SQL Assistant is connected through Teradata.NET or Oracle.net, not ODBC The query consists of a single INSERT, UPDATE, or DELETE statement The statement must not contain any LOB parameters [?B or?c]. The Batch size in the Import tab of the Options dialog box is not specified as one If the Batch size is set to one, the Batch import mode is not used. For larger values, the data provider packs the data for the specified number of rows into a batch (as long as it fits into a 64k parcel), and executes one batch at a time. In general, the larger the batch size, the better the performance. With larger batch sizes: Data for a single batch must fit into a 64k parcel The entire Import file is loaded into memory If a batch import results in an error, the entire batch is rolled back and Teradata SQL Assistant reports which record caused the error If multiple records result in errors in a single batch, the indicated record might not be the first problem record in the file The Silently discard rows that cause constraint violations option on the Import tab of the Options dialog box can be selected if the data is just a sample, or if loss of duplicates or other rows that cause constraint violations are not a problem. If this option is selected, all errors are ignored and Teradata SQL Assistant reports the number of rows that were imported and the number of rows discarded. Import Rules The following import rules are important: If the option Submit only the selected Query text, when highlighted is selected in the Options dialog box, only the highlighted portion of the query is submitted. For more information, see also Submitting Part of a Query on page Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

101 Chapter 2: The Query Window Importing Data The query might contain multiple statements only if it contains Teradata INSERT, UPDATE, or DELETE statements. For other databases, or statements, it is limited to a single SQL statement. The import file must be a delimited text file containing data values that are separated from each other with a delimiter character. To set the delimiter character, see Setting Export/ Import Options on page 131. The number of data values on each record must be the same as the number of parameter markers in the SQL query. The maximum number of parameters in a query is database dependent. For Teradata V2R5, it is 2,048. The data values must be enclosed within quotes unless the Export option, Enclose Exported/Imported Column Data in, is set to None. To set this option, see Setting Export/ Import Options on page 131. Data values must not contain the delimiter character unless they are enclosed in quotes. Data values that are enclosed in quotes must not contain the delimiter character as their first character. Data values must not contain carriage return (end of line) characters. Date, time and timestamp values must be in the following format: YYYY-MM-DD HH:MM:SS YYYY-MM-DD HH:MM:SS When using an ODBC connection with a Teradata data source, they must be in the format specified for the corresponding column on the CREATE TABLE statement. Either - or / can, however, be used as the date separator. You can create the import file using the export feature of Teradata SQL Assistant. Be sure when importing the file to select the option to skip the first row (header) of the file. Alternatively, you can create the file using a text editor or by saving a spreadsheet in the appropriate delimited format. Defining the Null Value for an Import Operation The default value for this option is?. This means a question mark character is used to represent a null value resulting from a SELECT statement. This string is also used in an import file to indicate that the corresponding column should be assigned a null value. Many spreadsheet and database applications can save data in tab delimited format. In most cases, they do not allow you to specify a null character, but simply write nothing to the file. If you want to import data from a file like this, set this field to a zero length string by deleting the contents of the field. Teradata SQL Assistant for Microsoft Windows User Guide, Release

102 Chapter 2: The Query Window Using the Query Window Shortcut Menu To indicate a null data value in the import file 1 Select Tools > Options. 2 Select the Data Format tab. 3 In the field Display this string for Null data fields, fill in the string desired. Use the string you have defined for the display of NULL values. The default is a question mark (?). This string, possibly quoted, should be the only thing between the surrounding delimiter characters. Generating Multiple Reports From a Single Query You can generate multiple reports from a single query using SQL Assistant s import feature. This is often useful for DBAs. Example to show the DDL for a list of tables 1 Create an import file (typically a.txt file) that contains a list of tables, one table name per line. 2 Select File > Import Data. 3 Enter the following into the Query Window: SHOW TABLE? 4 Click. This displays a file selection dialog box. 5 Select the file you saved. The status bar at the bottom of the Query window shows row numbers as they are loaded. 6 To obtain the results of the query, go to the directory in which you saved the import file and open the.log file. Using the Query Window Shortcut Menu The purpose of the shortcut menu is to access routine query functions or to control its execution. The shortcut menu is specific to the active window. In this case, it provides a quick way for performing tasks specific to the Query Window. Displaying the Shortcut Menu Functions in the Query Window Displaying the Shortcut Menu The following table describes the commands on the default shortcut menu. 102 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

103 Chapter 2: The Query Window Using the Query Window Shortcut Menu To display the shortcut menu Do one of the following: Right click in the Query Window. Press Shift-F10. Press the Context Menu key on your keyboard. Table 16: The Query Window Shortcut Menu Commands and Descriptions Command Execute Query Builder Add to Favorites Cut Copy Paste Find Find Next Replace Format Query Set Font Select All Insert date Audible Notification Minimize on Execution Description Submits the query currently in the Query Window. Each statement in the query is submitted separately to the database. Helps you create statements in the Query Window. Saves the current query to a list of favorites which can be reused from Query Builder. Cuts the selected text from the Query Window and places it to the Clipboard. Copies the selected text from the currently active window to the Clipboard. Pastes the contents of the Clipboard into the query at the current insertion point. Displays the Find String in Query dialog box, allowing you to search for a particular string in the currently active window. Find highlights the first occurrence of the string. Repeated use of the Find Next button highlights successive occurrences of the search string. Finds the next occurrence of the string that was specified in the previous Find command. If you have not yet issued a Find command, it acts as a Find command Finds and replaces any, or all, occurrences of a particular string in the Query Window. This command is useful for quickly replacing a string that occurs multiple times in your query. For example, use this command to change the name of a database referenced multiple times within a macro or script. Formats a query based on a search for specific keywords. Displays a Font dialog box allowing you to change the font used in the current window. The Font Name and Font Size attribute are saved for future use. Separate values are stored for each type of window. Selects all the text in the current window. All text is highlighted and future actions apply to the entire window as a whole. The primary use of this function allows you to copy the query to the Clipboard. Inserts today s date into the query at the current insertion point. If part of the query is selected, this function replaces the selected text with today s date. The format of the date is always 'yyyy-mm-dd' enclosed in quotes, or in '#' signs for Microsoft Access. Causes the system to beep when the query is complete and all data has been returned to your PC. The beep also occurs if the query times out, the number of rows exceeds the output limit, or the query is canceled. When selected, automatically minimizes the Teradata SQL Assistant window when a query is being processed. Teradata SQL Assistant for Microsoft Windows User Guide, Release

104 Chapter 2: The Query Window Using the Query Window Shortcut Menu Table 16: The Query Window Shortcut Menu Commands and Descriptions (continued) Command Prompt for Notes Description An input dialog box displays whenever you submit a query to enter a note that is stored in the history table along with the query. Functions in the Query Window The Query Window is similar to any Windows-based text editor, allowing for functions such as drag-and-drop editing, cutting, copying, and pasting. Clipboard Support Clipboard support is provided in the Query Window. Table 17: Clipboard Support Edit Commands Action On the Toolbar From the Menu Shortcut Keys Cut Click Edit > Cut Ctrl+X Copy Click Edit > Copy Ctrl+C Paste Click Edit > Paste Ctrl+V Undo Click Edit > Undo Ctrl+Z Redo Click Edit > Redo Ctrl+Y 104 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

105 CHAPTER 3 The Answerset Window The purpose of this section is to help you become familiar with the Answerset window and its features and functions. This section contains the following information: Introduction to the Answerset Window Using the Answerset Window Charting Answerset data Formatting an Answerset Exporting a Resultset Understanding Large Object Support Using Answerset Shortcut Menus Introduction to the Answerset Window The Answerset window contains one or more tabs. Each tab displays either a spreadsheet or textual output that represents the results from an executed statement. You can sort the output in a number of ways and print as bitmaps in spreadsheet format. Individual cells, rows, columns, or blocks of columns can be formatted to change the background and foreground color as well as the font style, name, and size. You can make other modifications such as displaying or hiding gridlines and column headers. The table can be resized by stretching the Answerset window using standard Windows sizing techniques. Individual columns, groups of columns, rows, or groups of rows can also be sized. Output rows can be viewed as they are being retrieved from the database. Following is an example of an Answerset window: Teradata SQL Assistant for Microsoft Windows User Guide, Release

106 Chapter 3: The Answerset Window Using the Answerset Window You can set an option to prevent existing Answerset windows from being automatically closed when you submit a new query. For more information, see Setting Answerset Options on page 120. You can save Answerset output to a file. For more information, see Saving an Answerset to a File on page 114. Using the Answerset Window This section provides the following information about using the Answerset Window: Viewing Your Results Adjusting Row Height Adjusting Column Width Re-arranging Column Order Keeping Selected Columns From Scrolling Out of View Viewing Long Strings of Text Within Cells Closing Answerset Windows Before Submitting a New Query Selecting All Answerset Rows Merging Cells in the Answerset Displaying the SQL That Generated an Answerset Hiding Columns/Showing All Columns Closing All Answersets Hiding Column Headers Hiding Row Headers Displaying Totals for Numeric Columns Displaying Aggregate Values Finding a Text String in the Results Grid Naming an Answerset Window Naming an Answerset Tab Deleting an Answerset Tab Opening a Saved Answerset Saving an Answerset to a File Saving as XML Copying an Answerset to Notepad Printing an Answerset Using Print Preview Cancelling Print Jobs Sorting an Answerset Filtering the Answerset 106 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

107 Chapter 3: The Answerset Window Using the Answerset Window Viewing Your Results Adjusting Row Height Grouping the Answerset Setting Answerset Options Setting Data Format Options Changing the Font for the Entire Window Zooming the Answerset Window Use the Page Up, Page Down, Home and End keys as well as scroll bars to scroll through the results. Output rows can be viewed as they are being retrieved from the database. To adjust the row height Adjusting Column Width 1 Move the mouse pointer to the line directly under the row header. When correctly positioned, the mouse pointer changes to a two-headed vertical arrow. 2 Drag the two-headed arrow up or down to size the row and then release the mouse button. To change multiple rows, highlight all the rows by placing the mouse pointer on the row number and dragging. Then follow steps 1 and 2, above. To adjust the column width 1 Move the pointer onto the column separator directly to the right of the column heading. The pointer changes to a two-headed horizontal arrow. 2 Drag the column left or right to size the column and then release the mouse button. To change multiple columns, highlight all the columns by placing the mouse pointer on the column header and dragging. Then follow steps 1 and 2, above. Note: If you want to reset the width to fit the widest data value in that column, double click the right hand edge of the column header. Re-arranging Column Order In Move Columns mode, you can re-arrange the columns by clicking on a column header and dragging it to the desired position. Note: While in this mode, columns can no longer be selected by clicking on their column headers. Teradata SQL Assistant for Microsoft Windows User Guide, Release

108 Chapter 3: The Answerset Window Using the Answerset Window To turn on Move Columns mode Do one of the following: Right-click in the Answerset window, select Move Columns. Click on the Answerset toolbar. To switch off Move Columns mode, repeat this procedure. Keeping Selected Columns From Scrolling Out of View Freezing columns prevents them from being scrolled off the screen when you scroll a wide Answerset to the right. To freeze columns in the Answerset 1 In the Answerset window, select the column you want to freeze. Note: The selected column and all columns to the left of the selected column freeze. 2 Do one of the following: Right-click in the Answerset window and select Freeze Columns. Click on the Answerset toolbar. The columns remain frozen until you repeat Step 2 a second time to unfreeze them. Viewing Long Strings of Text Within Cells You can select an option that wraps the text onto multiple lines if it does not fit entirely within the cell or column on one line. To wrap text onto multiple lines an Answerset 1 In the Answerset window, select the cells or columns you want to wrap. 2 Do one of the following: Right-click in the Answerset window and select Wrap Text. Click on the Answerset toolbar. The cells remain wrapped until you repeat Step 2 a second time to unwrap them. Note: Wrap Text is hierarchical. If you wrap individual cells they remain wrapped even if you wrap/unwrap the column that contains those cells. Closing Answerset Windows Before Submitting a New Query You can prevent an Answerset from being automatically closed, still allowing you to close the window manually. 108 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

109 Chapter 3: The Answerset Window Using the Answerset Window To prevent an Answerset from being automatically closed Do one of the following: Right-click in the Answerset window and select Do Not Close Click on the Answerset toolbar Selecting All Answerset Rows You can select all rows in the Answerset window. To select all Answerset rows Do one of the following in the Answerset window: Press Ctrl+A. Click the top/left header cell (at the intersection of the Column and Row headers.). All rows in the Answerset window are selected. Merging Cells in the Answerset Use this option to merge the cells in a column. You can select one or more columns. (If you select only one or more cells, the merge applies to the entire column(s) of the cells selected) If consecutive rows contain the same data (within any of the selected columns), those cells appear as a single 'merged' cell. If you have previously applied 'Merge Cells' to a column, applying it again restores the column(s) to an un-merged state. This option merges only cells that contain the same data. Cells with other data in the same column do not merge. If there are no consecutive cells with the same data, nothing happens. This is not an error. To merge cells in the Answerset 1 Select the column that contains cells you want to merge. 2 Do one of the following: Right-click the selected column and select Merge Cells. Click on the Answerset toolbar. Teradata SQL Assistant for Microsoft Windows User Guide, Release

110 Chapter 3: The Answerset Window Using the Answerset Window Displaying the SQL That Generated an Answerset You can display the SQL statement that generated an Answerset. To display the SQL that generated an Answerset Do one of the following: Right-click in the Answerset window and select Display SQL / Answer Ensure the Answerset window is active, then click on the Answerset toolbar to toggle between the Answerset and the SQL. The SQL statement that generated the data replaces the results in this Answerset. Hiding Columns/Showing All Columns You can hide columns or show all columns in the Anwserset using the following steps. To hide column(s) or show all columns Do one of the following.: In the Answerset, right-click the columns to hide and select Hide Columns. To show all columns, right-click in the Answerset and select Show All Columns. Closing All Answersets To close all Answersets Hiding Column Headers Select File > Close all Answersets. To hide column headers 1 In the Answerset window, place your cursor into any cell in any column. 2 Do one of the following: Click on the Answerset toolbar. Right-click in the Answerset window and select Column Headers. The columns remain hidden until you click again to display them. This preference applies only to the current tab of the current Answerset window. 110 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

111 Chapter 3: The Answerset Window Using the Answerset Window Hiding Row Headers To hide row headers 1 In the Answerset window, place your cursor into any cell in any column. 2 Do one of the following: Click on the Answerset toolbar Right-click in the Answerset window and click Row Headers. The rows remain hidden until you click again to display them. This preference applies only to the current tab of the current Answerset window. Displaying Totals for Numeric Columns To display totals at the bottom for numeric columns 1 In the Answerset window, place your cursor into any cell in any column. 2 Do one of the following: Right-click to display the Shortcut menu and click Add Totals. Click on the Answerset toolbar. The totals display for all numeric columns. The totals remain after the Answerset has been sorted. Totals do not appear in future Answerset windows unless Add Totals is activated again. Note: The SUM function uses Floating Point values, so totals are only accurate to 15 total digits. To format columns to display commas, see Displaying Commas to Mark Thousand Separators on page 128. To format columns to display decimal places, see Displaying Decimal Places on page 128. Displaying Aggregate Values Teradata SQL Assistant allows you to quickly calculate aggregate values for selected portions of the Answerset window. To display aggregate values 1 Highlight the cells you want to aggregate. 2 Release the mouse button. The Sum, Count, Average and Standard Deviation appear on the status bar. Note: The Aggregate function uses Floating Point values, so totals are only accurate to 15 total digits. Teradata SQL Assistant for Microsoft Windows User Guide, Release

112 Chapter 3: The Answerset Window Using the Answerset Window You can select a row, multiple rows, a column, multiple columns, or any block of cells. Nonnumeric cells included within your selection are ignored. Finding a Text String in the Results Grid You can find a specific text string in the results grid. To find text in the results grid 1 With the grid window active, select Edit > Find. The Find dialog box displays. Table 18: Find Dialog Box 2 Complete the following options: Option Description Find What Enter the desired text string, or select an existing text string. Match Case Search current column only Use wildcard characters (* and?) Find Next Find All Select this checkbox to find text that matches the case of the search string. Clear this checkbox to search the entire spreadsheet. If multiple cells are selected, the current cell is marked with a bold outline. The default is selected, but the new setting is retained if it is changed. Note: Searches are faster when they are limited to a single column. Select this checkbox to treat any question mark symbol (?) and asterisk symbol (*) in the search string as a wildcard character. The question mark represents any single character. The asterisk represents any string of zero or more characters. Click to search for the next occurrence of the search string within the current grid. The search starts at the current cell position in the grid. Click to find all occurrences of the search string and display them in a listbox. Clicking an item in the list moves the selection in Answerset to the corresponding cell. The cell scrolls into view if necessary. 112 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

113 Chapter 3: The Answerset Window Using the Answerset Window Naming an Answerset Window Instead of having Teradata SQL Assistant title the saved Answersets for you, you can name the returned Answersets. To name an Answerset window 1 Do one of the following: Select Window > Set Title. Press F12. 2 In the Set Title dialog box, enter a new title for this Answerset. Naming an Answerset Tab When Answersets appear in tabs, you can set the name for each individual tab. To name an Answerset tab 1 Right-click on the Answerset tab and select Rename. 2 Enter a new name for this Answerset tab. Deleting an Answerset Tab When Answersets appear in tabs, you can delete individual tabs and their contents. To delete an Answerset tab Opening a Saved Answerset Right-click on the tab and select Delete. To open a saved Answerset 1 Select File > Open Answerset. 2 Select the file you want to load into a new Answerset window. You can only load tab-delimited, delimited text, or Microsoft Excel files. 3 Click Yes or No when asked whether the first line of the file contains column headers. Note: To set the delimiter between columns for a Delimited Text file, see Setting Export/ Import Options on page 131. Teradata SQL Assistant for Microsoft Windows User Guide, Release

114 Chapter 3: The Answerset Window Using the Answerset Window Saving an Answerset to a File To save an Answerset to a file 1 Click the Answerset window to make it the active window. 2 Do one of the following: On the toolbar, click. Select File > Save Answerset As. Press Ctrl+S. 3 In the Save Answerset dialog box, enter a file name and select a format type. See File Format Types. 4 Select a location and click Save. File Format Types You can save an Answerset in the following formats: Table 19: Answerset File Format Types File Type Tab delimited [ANSI] Tab Delimited [Unicode] Tab delimited [UTF-8] Delimited Text [ANSI] Delimited Text [Unicode] Description The data is saved in a tab-delimited file using the current code page. Any special formatting applied to the Answerset is not saved, but can be read into a spreadsheet or a text editor for formatting. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved in a tab-delimited file using Unicode. Any special formatting applied to the Answerset is not saved, but can be read into a spreadsheet or a text editor for formatting. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved in a tab-delimited file using UTF-8. Any special formatting applied to the Answerset is not saved, but can be read into a spreadsheet or a text editor for formatting. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved is a delimited text file using ANSI. To set the use of quotes or to set the delimiter between columns, see Setting Export/Import Options on page 131. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved is a delimited text file using Unicode. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. 114 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

115 Chapter 3: The Answerset Window Using the Answerset Window Table 19: Answerset File Format Types (continued) File Type Delimited Text [UTF-8] Description The data is saved is a delimited text file using UTF-8. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. Microsoft Excel 2003 The data is saved to an Excel 2003 workbook. If there are multiple tabs in the Answerset window, you are asked whether you want to save all tabs to a single ExcelWorkbook. Any special formatting you have applied to the Answerset is retained. The entire Answerset is saved. Column and row headers are saved if they are currently visible. Microsoft Excel 2007 The data is saved to an Excel 2007 workbook. If there are multiple tabs in the Answerset window you are asked whether you want to save all tabs to a single ExcelWorkbook Any special formatting you have applied to the Answerset is retained. The entire Answerset is saved. Column and row headers are saved if they are currently visible. PDF Document [*.pdf] The data is saved as a PDF file. Any special formatting you have applied to the Answerset is retained. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. Web Page [*htm] The data is saved as a table in HTML. Any special formatting you have applied to the Answerset is retained. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. XML Document The data is saved as an XML document. No special formatting is retained. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. See Saving as XML on page 115. Note: Hidden columns are not saved if you save as HTML. Note: When saving an answerset tab, spreadsheet data is saved using one of the file types from the table above, while Text data is saved using one of the file types described under To save a query on page 83. Saving as XML When saving as XML, the domain name hierarchy is Answerset<n>, DataRow, <ColumnNames>. For example: <?xml version="1.0"?> <Answerset1> <DataRow> <FirstName>John </FirstName> <LastName>Smith </LastName> <Number> </Number> </DataRow> Teradata SQL Assistant for Microsoft Windows User Guide, Release

116 Chapter 3: The Answerset Window Using the Answerset Window Copying an Answerset to Notepad Printing an Answerset To copy a whole Answerset to Notepad 1 Make the Answerset active. 2 Select File > Copy to Notepad. The contents of the whole Answerset is copied to Notepad. Note: If you select a subset of cells within the Answerset, only the selected cells are copied to notepad. Using Print Preview To print an Answerset 1 Click the Answerset window to make it the active window. 2 Do one of the following: On the toolbar, click. Select File > Print Answerset. Press Ctrl+P. The standard Windows Print dialog box appears. Printers are configured through this Print dialog box. 3 Do one of the following: To print the entire Answerset: Under Print Range, select All. To print a partial section of the Answerset: a b Go to the Answerset window and highlight the cells, columns, or rows you want to print. Under Print Range, select Selection. The Print Preview dialog box allows you to preview Answerset or History window spreadsheet data before printing. Print preview is only available from the Answerset window and the History window. These two windows print data in the form of a spreadsheet. When printing the Query window or a Text style Answerset window, Print Preview is not available. To use the Print Preview window Do one of the following: Select Print Preview under File on the toolbar. To view one or more pages at a time, use the page icon. 116 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

117 Chapter 3: The Answerset Window Using the Answerset Window Use the Zoom icon to change the view size. To print, click the Print icon. View a different page by using the select page field. Cancelling Print Jobs Print jobs can be canceled through the Windows Print Manager. To cancel a print job 1 Go to Start, select Settings, then click Printers. 2 Double-click your printer. 3 From the Document menu, select Cancel. Sorting an Answerset There are two ways to sort an Answerset: quick sort or full sort. To sort an Answerset using quick sort Click the sort icon at the top of any column, to sort the data by that column only. After sorting, the icon indicates the direction of the sort. The output from certain statements, such as EXPLAIN, cannot be sorted this way. To sort an Answerset using full sort Full sort allows sorting by data in multiple columns: 1 Do one of the following: On the toolbar, click. Right-click in the Answerset window, then select Sort. Select Edit > Sort. In the Sort Answerset dialog box, all columns in the active window are presented in the Available Columns list box. 2 Select the column name in the Available Columns list box, or use the up or down arrow keys to highlight the column name and press Enter or click the Add button. This moves the column name to the Sort keys list box. By default, the sort direction for this new sort column is ascending. If you click a column in the Sort Keys list box, or select the item using the arrow keys or mouse and press Enter, it reverses to descending sort order. Teradata SQL Assistant for Microsoft Windows User Guide, Release

118 Chapter 3: The Answerset Window Using the Answerset Window Filtering the Answerset 3 To remove a sort column from the list, double-click the column name, or select it and press the Delete key or click the Remove button. You can also remove all columns from the Sort Keys list by pressing the Clear button. 4 After you select the columns by which you want to sort and the direction in which you want to sort, click Sort. You can filter by multiple columns, where each filter is applied to the currently displayed rows only. To filter the Answerset Grouping the Answerset 1 Click on the Answerset column header. A drop down window appears. 2 Do one of the following: Click on the check boxes next to the list of column values to include or exclude rows that contain that column value. For dates and timestamps, the list is replaced by a Tree that allows you to select at the year, month, day level. Click Number filters,then select a condition from the displayed sub menu. In most cases, a dialog into which you can enter a value for the condition appears. Click Text filters, then select a condition from the displayed sub menu. In most cases, a dialog into which you can enter a value for the condition appears. Click Date filtersthen select a condition from the displayed sub menu. In some cases, a dialog into which you can enter a value for the condition appears. Click Filter by Color then click one of the listed colors to display only those rows that use that background color in this column. Click Clear filter from xxx to remove any existing filter from this column. The type of filter displayed (Number, Date or Text) will depend on the data type of the column. Note: Use Find instead of filtering a large spreadsheet by a unique column. Teradata SQL Assistant can display data rows in the Answerset window in a grouped, sorted order. To use grouping, click on the Allow Grouping tool button. To group data columns in the Answerset window 1 Ensure the Answerset window is active and click the Allow Grouping button. This displays a Group Bar above the spreadsheet. 2 Drag the column header you want to group by to the Group Bar. 118 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

119 Chapter 3: The Answerset Window Using the Answerset Window If you group by a single column, each row in that column displays the column name followed by the column value and the number of rows that have this value in parentheses. To open a group, click on the + symbol at the left of the row. 3 To group by multiple columns, drag the additional column headers to the right of the previous ones on the group bar. They are connected in descending order. The top level group continues to display the column name and data value, but does not display the number of rows that contain that value. The lower level Group rows display the column number (starting at column zero) followed by the data value for that group. Each header you drag to the Group Bar display a Sort icon to indicate the current sort direction. You can reverse the direction by clicking on this icon. 4 To ungroup the rows, drag the headers back to the spreadsheet header bar, or simply click the Allow Grouping button a second time. Teradata SQL Assistant for Microsoft Windows User Guide, Release

120 Chapter 3: The Answerset Window Using the Answerset Window Setting Answerset Options Use the following procedure to control the Answerset and the appearance of data in the Answerset by setting options on the Answerset tab of the Options dialog box. Additional data options that apply to both the Answerset window and to Exported data can be set on the Data Format tab. See Setting Data Format Options on page 121. To set Answerset options 1 Select Tools > Options. 2 Click the Answerset tab. Table 20 explains each option. Table 20: Answerset Tab in the Options Dialog Box Option Display alternate Answerset rows in color Open new Answersets in Move Columns Mode Description Select this item to display colors for alternate rows in the Answerset. Use the color picker to select a color. The color choices include a Custom tab, a Web tab and a System tab. The default is cleared. Selecting this option activates Move Columns mode when a new Answerset opens, which allows you to re-arrange the columns by dragging columns to the desired position. The default for Move Columns mode is off. 120 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

121 Chapter 3: The Answerset Window Using the Answerset Window Table 20: Answerset Tab in the Options Dialog Box (continued) Option Display grid lines in future Answerset columns Display 1000 separators in numeric columns Display negative numbers in Red Display Column Titles rather than Column Names Wrap wide headers across 2 lines if the data is narrow Display Float values using scientific notation Use default file names for LOB columns Default file type for BLOB columns Maximum number of answer rows to display Description The default value of this option is selected. Gridlines appear when a new Answerset window is created. Right-click in the Answerset window and select Grid Lines. On the Answerset toolbar click. The default value of this option is selected. This means 1000 separators (commas) appear in numeric columns. This option displays negative values in red in the Answer pane. The default value of this option is cleared. This option allows the Answerset columns to display titles rather than names. The default value of this option is selected. This means the column title is used as the column header when returning data to the Answerset window. If cleared, column names appear. Column titles can be defined at the time a table is created, or as part of a SELECT statement. Generally, a column title is more descriptive than the column name itself. The default value of this item is selected. This option allows column titles that are wider than the maximum data width in that column to be wrapped across two lines to display narrower columns. If this option is not selected, column titles display on a single line. The default value of this option is cleared. If selected, Float column data displays in scientific notation. For example, e04. The default value of this option is cleared. If selected, the file names used for LOB columns are constructed from the column title and a default file type. You are not prompted to enter this information. This file type is used for BLOB columns when the above option is selected. The default value of this option is This number is the maximum number of answer rows that are retrieved from the database before you are prompted whether you want to continue retrieving further rows. If you want all remaining rows to be retrieved without further prompts, answer No to the following question: Cancel at <number> rows in accordance with settings? When prompted to continue, all remaining rows are retrieved without any further prompts. Setting Data Format Options Control the format of data values that are both displayed the Answerset window and Written to an Export file by setting options on the Data Format tab of the Options dialog box. Teradata SQL Assistant for Microsoft Windows User Guide, Release

122 Chapter 3: The Answerset Window Using the Answerset Window To set Data Format options 1 Select Tools > Options. 2 Click the Data Format tab. Table 21 explains each option. Table 21: Data Format Tab in the Options Dialog Box Option Display dashes between bytes for binary data values Write Byte Order Mark [BOM] to CLOB output files Display BigInt and Decimal(16)+ values as strings Display this string for Null data values Description When selected, a dash appears between each byte of the value for ease of reading, for example 63-B1-A3-62. The default is selected. Select this option to add a Byte Order Mark at the start of each CLOB file. The default is cleared. When checked, large numeric values are stored as strings for Excel compatibility. When cleared, values with more than 15 digits are rounded when saved to Excel. The default is cleared. Enter the string to be displayed in place of Null data fields in the reports and imported/ exported files. The default for this setting is?. 122 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

123 Chapter 3: The Answerset Window Using the Answerset Window Table 21: Data Format Tab in the Options Dialog Box (continued) Option Display dates in this format Description The drop-down list contains pre-defined options to select. The characters d, m, and y to signify the day, month and year components can be added to the list. It also accepts /, -, ',' and space characters can be added as delimiters. Day formats are specified by repeating characters as follows: d Day number without leading zero dd Day number with leading zero ddd Day name abbreviated dddd Day name in full Month formats are specified by repeating characters as follows: m Month number without leading zero mm Month number with leading zero mmm Month name abbreviated mmmm Month name in full Year formats are specified by repeating characters as follows: yy Year, represented with 2 digits yyyy Year, represented with 4 digits Insertion Characters: The dash, slash, comma, period and space characters are insertion characters. For example: dddd, dd mmm yyyy displays Monday, 07 Mar 2008 Wheras d-mm displays 7-03 Note: Lowercase 'm' is automatically changed to uppercase 'M.' Number of decimal places to display for Float columns Handle Binary/Byte columns as BLOBs if size > Handle Varchar columns as CLOBs if size > Entering a value between 0 and 9 allows you to specify the number of decimal places initially displayed for all data that originated from a FLOAT column. The default value for this option is 2. You can change the setting for selected columns. From the shortcut menu, select Decimal Places. Enter a number between 0 and The default value for this option is All Binary/Byte columns are treated as BLOBs Binary/Byte columns are never treated as BLOBs Other Binary/Byte columns larger than this value are treated as BLOBs Each BLOB is returned to a separate file on your PC. Regular Binary/Byte data appears in the grid as a hex string. This options allows you to set a size limit after which a Varchar column is handled as a CLOB. The default is Teradata SQL Assistant for Microsoft Windows User Guide, Release

124 Chapter 3: The Answerset Window Charting Answerset data Changing the Font for the Entire Window To change the font for the entire window 1 Do one of the following: From the View menu, select Set Font to display the Font dialog box. Right-click to display the Shortcut menu, and then select Set Font. 2 Change the font name, style, and size. Note: The font change applies to the current window and all future Answerset windows. Zooming the Answerset Window You can zoom the contents of a window in and out by using the Ctrl key and mouse wheel. To zoom the active window 1 Ensure the window is active. 2 Hold the Ctrl key and spin the mouse wheel. The display zooms in and out. Charting Answerset data Charts can be created based on the data within an Answerset grid. By default, the chart appears in a new tab within the same Answer window. An option exists on the Chart Definition dialog box to display the new chart in a separate window. This would provide the option to view the chart and data at the same time. To create a chart 1 Right-click in the Answer window and click Chart..., or Click the button on the Answerset toolbar. 2 On the Chart Definition dialog box select the Chart Type you wish to display 3 Enter or verify the From / To Row number for the rows to be plotted 4 Select or verify the Column(s) whose data you wish to chart 5 Select or enter any additional options for the chart, and press OK 124 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

125 Chapter 3: The Answerset Window Charting Answerset data Table 22: Chart Definition Dialog Box Control Chart Type Horizontal Rectangular 3D From Row To Row X Axis Labels Data Columns X Axis Title Y Axis Title Chart Title Display Chart in a new window Description This drop down list allows you to select the type of chart you wish to create. The picture below shows a simple example. The default is a line chart. Draw Horizontal bars rather than vertical Columns. Used for Bar types only. The default is cleared. Draw rectangular bars rather than cylindrical bars. Used for Bar types only. The default is cleared. Draw a 3D chart. The default is selected. Note: A chart can also be changed to 2D by changing its rotation and elevation This specifies the first row to be included in the data range to be plotted. This value is pre-populated if a block of cells is currently selected. This specifies the last row to be included in the data range to be plotted. This value is pre-populated if a block of cells is currently selected. This column provides the data labels for the X Axis. Select <RowNumber> to use the row number instead of a data column. Select one or more numeric columns whose data you wish to chart. Only one column can be selected if the Chart Type is Pie. The highlighted columns are pre-selected if a block of cells is currently selected. If entered, this text appears below the X axis labels If entered, this text appears to the left of the Y axis labels. If entered, this text appears above the chart. Select this box to display the chart in a new window. The default is checked if the Answerset Mode is Each Resultset. Otherwise, it is cleared. Teradata SQL Assistant for Microsoft Windows User Guide, Release

126 Chapter 3: The Answerset Window Formatting an Answerset Working with Charts A legend appears at the right for pie charts and for other chart types where more than one data series (column) is plotted. If you hover the cursor over a Pie segment or a Bar, the description of that data point and its value appears in a tool tip. For non discreet chart types, such as Line or Area, only the description appears. Charts have a context menu and shortcut keys as described below: Table 23: Chart Menus and Shortcut Keys Menu Shortcut Description Copy Ctrl+C Copy the chart to the clipboard as a picture. Modify Set Font Display the Chart Definition dialog box which allows the chart attributes to be changed. Change the font used on this chart. Rotate Left Ctrl+ left arrow Rotate the chart to the left (counter-clockwise). Rotate Right Ctrl+ right arrow Rotate the chart to the right (clockwise). Decrease Elevation Ctrl+ down arrow Decrease the angle of elevation. Increase Elevation Ctrl+ up arrow Increase the angle of elevation. Ctrl+ + Ctrl+ - Ctrl+0 Zoom in. Zoom out. Reset to 100% zoom factor. Formatting an Answerset You can format the colors, font name, font style, and font size of a block of cells, individual cells, rows, columns, or the entire spreadsheet. You can also specify the number of decimal places displayed and if commas appear to mark thousand separators in numeric columns. The following sections explain how to format an Answerset: Formatting a Block of Cells Formatting a Single Cell Formatting a Single Row or Column Formatting Multiple Rows or Columns Formatting the Entire Spreadsheet Displaying Commas to Mark Thousand Separators Displaying Numbers in Scientific Notation Displaying Decimal Places 126 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

127 Chapter 3: The Answerset Window Formatting an Answerset Changing the Font for the Entire Window Zooming the Answerset Window Formatting a Block of Cells To format a block of cells 1 Select the area to be formatted. 2 Right-click and select Format Cells. 3 Set the formatting options you want to change. Formatting a Single Cell To format a single cell 1 Double-click the Answerset cell to display the Format Cells dialog box. 2 Set the formatting options you want to change. Formatting a Single Row or Column To format a single row or column 1 Double-click the row or column header to display the Format Cells dialog box. 2 Set the formatting options you want to change. Formatting Multiple Rows or Columns To format multiple rows or columns 1 Select the row or column to be formatted by clicking on the row or column heading and dragging to highlight. 2 Right-click to display the Shortcut menu. 3 Select Format Cells to display the Format Cells dialog box. 4 Set the formatting options you want to change. Teradata SQL Assistant for Microsoft Windows User Guide, Release

128 Chapter 3: The Answerset Window Exporting a Resultset Formatting the Entire Spreadsheet To format the entire spreadsheet 1 Press Ctrl+A to highlight all cells, then right click and select Format Cells. The Format Cells dialog box opens. 2 Set the formatting options you want to change. Note: The formatting change applies to the current Answerset window only. Displaying Commas to Mark Thousand Separators To display commas 1 Right-click in the Answerset cell you want to change and select Format Cells. 2 Select Display 1000 separators. Displaying Numbers in Scientific Notation To display numbers in scientific notation 1 Right-click in the Answerset cell you want to change and select Format Cells. 2 Select Use Scientific notation. Displaying Decimal Places To display decimal places 1 Right-click in the Answerset cell you want to change and select Decimal Places. 2 Select a number between 0 and 4. To designate up to 14 decimal places: a Right-click to display the Shortcut menu. b Click Format Cells to display the Format Cells dialog box. c Select the desired number of decimal places. Exporting a Resultset Output is normally displayed in an Answerset window in table format. However, you can redirect output from future queries (ASCII or Unicode) to a delimited text file (.txt), a web page (.htm), or Microsoft Access database file (*.mdb). 128 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

129 Chapter 3: The Answerset Window Exporting a Resultset This section provides the following information about exporting a Resultset: Exporting Results Single-Clicking to Display the Export File Saving Multiple Answersets Exporting to Access Formats and Data Types Setting Export/Import Options Setting Export Options Setting Import Options Exporting Results Before running a query, you can redirect the Answerset. To export results 1 Select File > Export Results. 2 Enter a statement in the Query Window. 3 Execute the query by clicking on the toolbar. 4 In the Export File dialog box, enter a file name. 5 From the Save As Type menu, select a file type. If you select a Microsoft Access database table (.mdb) the query must consist of a single statement that returns only one Answerset. If the database or table does not exist, one is created for you. If you select a delimited text file (.txt), the query can return multiple Answersets. If the specified file already exists, Teradata SQL Assistant asks you if you want to replace or append to the file. If you select an HTML file (.htm). the query exports the results into an.htm format that can be viewed as a web page. 6 When the export operation is complete, a confirmation message appears in the Export Bar immediately below the toolbars. Note: The delimiter and quotes used for exporting to a delimited text file can be set in the Options dialog box, Export tab. To set the quotes or the delimiter, see Setting Export/Import Options on page 131. Notice: The export option remains in effect until you click the Export option again to cancel it. Teradata SQL Assistant for Microsoft Windows User Guide, Release

130 Chapter 3: The Answerset Window Exporting a Resultset Single-Clicking to Display the Export File After an Answerset is exported, its name and location appear in the Export Bar. Click the Export bar to automatically open and display the Answerset that was just exported. Note: If SQLA doesn t recognize the exported file, it uses Windows File Association to select the appropriate application. Generally,.txt files are opened with Notepad,.htm opens a browser and.mdb opens Microsoft Access. The figure below shows the Export bar of an exported Answerset. Saving Multiple Answersets Multiple Answersets can be saved in multiple files. The file names for two Answersets or more are created by appending a number to the original file name. For example, if you specify Result.txt, and three Answersets are returned, the file names are: Result.txt Result2.txt Result3.txt Notice: If the specified file already exists, Teradata SQL Assistant asks if you want to replace or append to the first file in the set (in the above example, Result.txt). If the first file does not exist but other files do exist, they are overwritten with no warning. Exporting to Access Formats and Data Types The following applies to exporting data to Access tables: If the Access database does not exist it is automatically created in Access 2003 format. SQL Assistant can add an AutoNumber column (row number for the result set) as the first column in the export table. Specify whether this column is required using the Export tab of Options. When the Access Table is created, SQL Assistant maps Teradata data types to Access data types as follows: Table 24: How SQL Assistant Maps Teradata Data Types to Access Data Types Teradata Data Type Byte, SmallInt or Integer BigInt, Float, Decimal or Numeric Access Data Type Integer (maximum 32 bits) Float 130 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

131 Chapter 3: The Answerset Window Exporting a Resultset Table 24: How SQL Assistant Maps Teradata Data Types to Access Data Types (continued) Teradata Data Type Date BLOB or CLOB Other (up to 255 bytes) Other (over 255 bytes) Access Data Type Date Text (the LOB file name) Text Memo If the Access table already exists, the exported data either replaces or appends to it depending on whether or not you selected the Replace Table check box when specifying the table name. Note: If the data is being appended, ensure that the table definition matches the data being exported. The data types of the columns should match those of the select statement used in the export, with the optional addition of the AutoNumber column as the first column in the Access table. Setting Export/Import Options This section explains the Export/Import tab in the Options dialog box. See Setting Export Options on page 132 for more information on setting the Export tab and Setting Import Options on page 133 for setting the Import tab. After selecting any of these options, follow the instructions on Exporting Results on page 129 to learn how to export results. After exporting an Answerset, the status bar across the bottom of the main window provides the status of the action. To set export/import options 1 Select Tools > Options. 2 Click the Export/Import tab. 3 Select the options you want. The following table explains each option. Table 25: Import/Export Tab in the Options Dialog Box Option Use this delimiter between columns Description Defines the column delimiter. The default value is Tab. This same character is expected to delimit the data fields in an Import file. For Import operations, ensure this character does not occur within any of the data fields unless all data values are enclosed in quotes Teradata SQL Assistant for Microsoft Windows User Guide, Release

132 Chapter 3: The Answerset Window Exporting a Resultset Table 25: Import/Export Tab in the Options Dialog Box (continued) Option Description Enclose column data in Double Quotes encloses column data values in double-quotes Single Quotes encloses column data values in single-quotes Nothing the data values are not enclosed in quotes. This is the default value. For more information, see Default Preferences (Options) on page 158. Setting Export Options Use the following procedure to set export options in the Options dialog box. See Setting Export/Import Options on page 131 for more information on setting the Export/Import tab and Setting Import Options on page 133 for Import tab settings. After selecting any of these options, follow the instructions on Exporting Results on page 129 to learn about exporting results. Table 26: Export Tab in the Options Dialog Box To set export options 1 Select Tools > Options. 2 Click the Export tab. 3 Select the options you want. The following table explains each option. Option Write all exported answer sets to a single file Write the SQL and result status to the export file Write column headers to the export file Replace Carriage Returns in column data with blanks Write Byte Order Mark [BOM] to unicode export files Description Writes the output from a query that contains multiple select statements to a single file. The default value of this option is cleared, meaning output from a query that contains multiple select statements is written to multiple files. Writes the SQL and result status to the export file. The result status is the rows processed, elapsed time, and error messages (if any occurred). The default value of this option is cleared, meaning the SQL and result status is not written to the export file. Writes column headers to the export file before the data is written. Clearing this option might be useful if you plan to Import the data back into the database at a later time. If this option is not selected, no column headers are written. The default value is selected. Replaces carriage returns in column data with blanks when exporting to text files. If this option is not selected, carriage returns are left as is. The default value is cleared. When selected, all unicode or UTF8 export files include a BOM at their beginning. The default value is selected. 132 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

133 Chapter 3: The Answerset Window Exporting a Resultset Table 26: Export Tab in the Options Dialog Box (continued) Option Include a Row Number column in Microsoft Access export tables Honor the Answerset row return limit during exports Description When selected, an AutoNumber column is defined as the first column of a new export table. This column contains the row number of that row. The default value is selected. When selected, exported result sets are terminated when they reach the Maximum Row Limit set on the Answer tab. If there are multiple result sets, the limit applies to each individual set. The default value is cleared. Setting Import Options For more information, see Default Preferences (Options) on page 158. See Setting Export/Import Options on page 131 for more information on setting the Export/Import tab and Setting Export Options on page 132 for settings on the Import tab. After selecting any of these options, follow the instructions on Exporting Results on page 129. To set import options 1 Select Tools > Options. 2 Click the Import tab. 3 Select the options you want. The following table explains each option. 4 Click OK to close the Options dialog box and save your settings. Table 27: Import Tab in the Options Dialog Box Option Ignore the first record in the file (Skip Header) Convert localized decimal to a period on Import Maximum batch size for simple imports Silently discard rows that cause constraint violations Description Skips the header when importing the file. The default value is cleared. Replaces the local decimal point character with a period, allowing data in the local format to be imported to a database that always expects the decimal point to be a period. Clear this check box if the database expects the decimal point to be a localized character. The default value is cleared. The number of data rows that are sent to the database at one time for Batch Import. The default batch size is 20 rows. SQL Assistant ignores any errors that occur during the import operation and reports the number of rows that were imported and the number of rows discarded. The default value is cleared. For more information, see Default Preferences (Options) on page 158. Teradata SQL Assistant for Microsoft Windows User Guide, Release

134 Chapter 3: The Answerset Window Understanding Large Object Support Understanding Large Object Support Teradata SQL Assistant supports Large Objects. Large objects come in two types: Binary These columns can contain Pictures, Music, Word documents, and so on. The column type used by different vendors can be any of BLOB, IMAGE or LONG RAW. Text These columns contain text data such as Text, HTML, XML or Rich Text (RTF). The column type used by different vendors can be any of CLOB, TEXT, LONG or XML. Note: When using ODBC, the ODBC Data Source option Use Native Large Object Support must be selected to retrieve large objects. Go to Tools > Define ODBC Data Source > Configure > Options and select Use Native Large Object Support. When an Answerset contains a Large Object (LOB) column the action taken depends on the setting for the option Use default file names for LOB columns. If this option is selected, Teradata SQL Assistant uses the column title as the file name stub and a default value for the file type: txt or xml for CLOB data, or the value specified for Default file type for BLOB columns for BLOB data. If the option is not selected, SQL assistant asks you to provide a file name, a file type, and (optionally) a directory for each Large Object column. Each LOB data value is written to a separate file. The file name for each data value is created by joining the name, a sequential number, and the file type. For example, if you provide 'Photo' as the name and 'jpg' as the type, the files are named Photo001.jpg, Photo002.jpg, and so on. Although you can change the directory each time SQL Assistant requests a file name, only the last directory specified for a given Answerset is used. This directory is used for all LOB files related to this Answerset. The file names appear as links within the Answerset grid. If you click on a link, the corresponding file opens. This feature relies on Windows File Associations so you must specify the file type that is appropriate for the type of data stored in the LOB column. If the data is a graphic (file type BMP, JPG, JPEG, GIF, PNG, TGA, TIF, ICO or WMF) SQL Assistant offers you the option of displaying the picture within the Answerset grid itself. You can request that the picture be displayed instead of being saved to a file or in addition to being saved to a file. If the LOB is a Text type then there will be two additional, optional fields: The file encoding to use The encoding tells the system what character set encoding to use when writing the file. The default is UTF8. This writes a single byte for each of the standard ASCII characters, but writes two or three [encoded] bytes for each character that is not part of the standard ASCII character set. (The file will be identical to an 'ANSI' encoded file if it contains only standard ASCII characters.) The other option is Unicode which writes 2 bytes for each character. 134 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

135 Chapter 3: The Answerset Window Using Answerset Shortcut Menus A checkbox that specifies whether a Byte Order Mark (BOM) should be written The BOM is a two or three byte prefix that tells Windows what type of encoding was used. Some applications expect this prefix in order to determine how to read the file. Others do not expect a prefix and would therefore be confused by its presence. Using Answerset Shortcut Menus The purpose of the Shortcut menu is to provide fast access to commonly used functions. The Shortcut menu is specific to the active window. In this case, it provides a quick way for performing tasks specific to the Answerset window. You can also customize the shortcut menu to provide better functionality. Displaying the Shortcut Menu The following table describes all of the commands on the default menu. To display the Shortcut menu Do one of the following: From any table inside the Answerset window, click the right mouse button. Press Shift+F10. Table 28: The Answerset Window Shortcut Menu Commands and Descriptions Command Toggle SQL / Answer Copy Copy as HTML Find Find Next Add Totals Description Toggles between the data in the Answerset and the SQL used to get the answer. Copies the selected text from the currently active window to the Clipboard. Copies the selected text from the currently active window to the Clipboard in HTML format. Displays the Find String in Answerset dialog box, allowing you to search for a particular string in the currently active window. See Finding a Text String in the Results Grid on page 112. Finds the next instance of search item. Displays totals at the bottom for numeric columns. The totals remain after the Answerset has been sorted. Totals do not appear in future Answerset windows unless Add Totals is activated again. Chart Displays the Chart Definition dialog. For more information see Working with Charts on page 126. Sort Displays the Sort Answerset dialog box. For more information, see Sorting an Answerset on page 117. Teradata SQL Assistant for Microsoft Windows User Guide, Release

136 Chapter 3: The Answerset Window Using Answerset Shortcut Menus Table 28: The Answerset Window Shortcut Menu Commands and Descriptions (continued) Command Wrap Text Description Selecting Wrap Text causes text that is too long to fit within the selected cells to be wrapped into multiple lines. Selecting this item when the selected cells are already wrapped returns the text in those cells to a single line. Merge Cells Merges selected cells in a column in the Answerset. See Merging Cells in the Answerset on page 109 for more information. Decimal Places Format Cells Set Font Allow Grouping Freeze Column(s) Move Column(s) Hide Column(s) Show all Columns Gridlines Column Headers Row Headers Do Not Close Allows you to specify decimal places (0 to 4) in cells with numbers. Applies only to the column or columns selected. Applies to all rows even if all rows are not highlighted. For more information, see Formatting an Answerset on page 126. Allows you to format the color, font name, font style, and font size of a block of cells, individual cells, rows, columns, or the entire spreadsheet. It also allows you to add or remove decimal places and thousand separators. For more information, see Formatting an Answerset on page 126. Displays a Font dialog box allowing you to change the font in the cells in the Answerset window. This new font is also used in all future Answersets. The Font Name and Font Size attribute are saved for future use. Separate values are stored for each type of window. Displays a Group Bar above the spreadsheet. Selecting this item freezes the left most columns, preventing them from being scrolled off the screen when you scroll a wide Answerset to the right. All columns up to the current column or cell are frozen. Select Freeze Columns a second time to unfreeze the columns. The default for Freeze Columns is off. Places you into Move Columns mode, allowing you to re-arrange the columns by clicking on a column header and dragging it to the desired position. To switch off Move Columns mode, select this item a second time. The default for Move Columns mode is off. Note: While in this mode, columns can no longer be selected by clicking on their column headers. Hides a single or a multiple of columns. Select the column(s) you want hidden and click Hide Column(s). Redisplays any hidden columns. Displays or hides the gridlines in the Answerset window. You can toggle the gridlines On or Off. Displays or hides column headers. You can toggle the column headers On or Off. Displays or hides row headers. You can toggle the row headers On or Off. Prevent an Answerset window from automatically closing when a new query is executed. If On, the current Answerset window does not close when a new query is run, even if the automatic closing of Answerset windows option is in effect. For more information on this option, see Closing Answerset Windows Before Submitting a New Query on page 108. If Off, this Answerset window is closed when a new query is executed. 136 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

137 CHAPTER 4 The History Window The purpose of this section is to help you become familiar with the History window and its features and functions. This section contains the following information: Introduction to the History Window Using the History Window Editing History Records Saving, Copying, and Printing History Storing History Files The History Window Shortcut Menu Introduction to the History Window The History window is a table that displays your past queries and related processing attributes. The past queries and processing attributes are stored locally in a Microsoft Access 2000 database. This allows the flexibility to work with previous SQL statements in the future.[dr_ new graphic below] Following is an example of a History window: Clicking any cell in the SQL Statement column in the History window copies the SQL to the Query Window. You can display or hide the History window at any time. For more information on additional options, see Setting History Window Options on page 146. The most recently executed statement appears as the first row in the History window. The data can be sorted locally after it has been loaded into the History window. New entries are added as the first row of history no matter what sort order has been applied. For more information on sorting, see Sorting the History Records on page 143. Teradata SQL Assistant for Microsoft Windows User Guide, Release

138 Chapter 4: The History Window Introduction to the History Window You can review all the information connected to a query in the Edit History dialog box. This dialog box also allows you to edit the query text, the attached notes, and the result message. For additional information on this dialog box, see Displaying and Navigating the Edit History Dialog Box on page 148. The Columns of the History Window Table 29 lists the columns that appear in the History window. If the Query text is longer than 1000 characters, it is truncated to 1000, and followed by ellipses ( ). To view the entire text either click on it (to copy it to the Query window) or use the Edit History screen. Table 29: The History Window Column Descriptions Column Name Date/Time Source Elapsed Description The date and time at which the query ended. The data source name used. The total elapsed time for the query. Rows Teradata only: The number of rows matching the query submitted. Other databases: The number of rows returned or changed. See the second note below. Result Notes SQL Statement SQL Type Length Stmts Stmt Type User ID DBMS Time Fetch Time Seq (sequence) The result message. See the first note below. The note the user attached to the query. The query text. The type of database accessed. The length of the query, in characters. The number of statements in the query. A list of statement types used in the query. For example, CREATE TABLE, INSERT, SELECT. The user ID logged on. The time spent within the database. The time taken to return the data. The order the query was submitted to the database. Note: The History grid displays a Result column instead of the full SqlMessage information. This column is blank unless an error occurred. To see the full Result message, position the mouse so that the cursor is over the Result cell. Note: For Teradata systems only, if you abort a query in progress or decline to continue when the output limit is reached, the Rows column tells you how many rows matched the query you 138 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

139 Chapter 4: The History Window Using the History Window submitted rather than the number of rows that were actually returned to the PC. Other databases still report only the number of rows returned. Using the History Window This section provides the following information on using the History Window: Opening the History Window Closing the History Window Viewing the Result Message Viewing DBS Error Messages Viewing the History Rows Rearranging History Columns Filtering the History Rows Copying SQL from Previous History Record to the Query Window Copying SQL from Next History Record to the Query Window Selecting All History Rows Sorting the History Records Finding a Text String in the History Table Cleaning up the History Table Magnifying the History Window Setting History Window Options Opening the History Window To open the History window Select View > Show History. Closing the History Window To close the History window Do one of the following: With the History window active, select File > Close. Select View > Show History to clear the check box. Viewing the Result Message The History window displays a results message after a query is run. This message refers to information about the query including errors messages. Teradata SQL Assistant for Microsoft Windows User Guide, Release

140 Chapter 4: The History Window Using the History Window To view the Results message Hover the mouse over the Result column cell in the History pane. The entire message appears in a tool tip. For additional information on error codes and how to resolve problems, refer to Messages. Viewing DBS Error Messages Viewing the History Rows You can view the DBS error messages by pressing F11. This shows the most recent DBS error message no matter when it occurred. Use the PageUp, PageDn, Ctrl+Home and Ctrl+End keys as well as scrollbars to scroll through the history rows. Rearranging History Columns Filtering the History Rows History columns can be rearranged by dragging the column header to a new position. The new column order is used each time you open the History window. You can sort and filter the History rows is various ways to help organize the information. History Filter Operators All history rows are now stored in a single History database. The History Filter dialog box allows you to specify a set of filters to be applied to the history rows. The operators include >, <, =, and LIKE. The filter applies to the entire history table. When you click in the fields or boxes in the Filter dialog box, the possible operators and proper format appear at the bottom of the dialog box. Note: The operator box accepts only applicable operators for the filter function. To filter the History table 1 Select the History window. 2 Right-click in the History window and select Filter. 3 Set the history filter as needed. Table 30 explains the History filter options. 140 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

141 Chapter 4: The History Window Using the History Window Table 30: Description of History Window Filter Options History Filter Option Date Data Source User Name SQL Text Notes Statement Type Description Filters by date range. Clicking the combo box brings up a calendar. Place a filter operator (>, <, =,) in the operator box. To display the history for the most recent n days instead of basing it on a fixed date, select Previous n days and enter the number of days in the date box. Filter by data source name. Enter a data source name, which can contain wildcard characters. Select Use current Data Source to filter by the current data source only. Note: The Use current Data Source filter option is used only when the Allow connection to multiple data sources option is not selected. See Setting General Program Preferences on page 54 for information about setting this option. Shows only those rows for a specific User Name. Shows only those rows matching the specified string in the SQL text column. Note: See Using Wildcard Characters with the History Filter on page 142 for more information on using valid wildcard characters with this option. Shows only those rows matching the specified string in the Notes column. Note: See Using Wildcard Characters with the History Filter on page 142 to learn more about valid wildcard characters to use in this option. Shows only those rows in which the query contains the specified statement type. For example, Select or Create Table. Statement Count Show only those rows in which the query contains this many statements (Use operator <, > or =). Teradata SQL Assistant for Microsoft Windows User Guide, Release

142 Chapter 4: The History Window Using the History Window Table 30: Description of History Window Filter Options (continued) History Filter Option Description Row Count Shows only those rows in which the query effected this many rows (Use operator <, > or =). Elapse Time Shows only those rows in which the elapsed time matches the time entered (Use operator <, > or =, and specify the time as hh:mm:ss). Show successful queries only Select this box to filter for successful queries only. Queries with errors are ignored. Using Wildcard Characters with the History Filter The following wildcard characters are acceptable to use with the history filter: % matches zero or more characters _ matches exactly one character # matches a single numeric digit [xyz] matches a single occurrence of one of the enclosed letters: x, y, or z [0-5] matches a single occurrence of this range of characters: 0 to 5 Wildcard matches are not case specific. To match the percentage character (%) by itself, enclose the character in brackets. For example, enter %[%]% in the SQL Text field to return all rows containing a % sign in the SQL text. Copying SQL from Previous History Record to the Query Window You can copy the SQL from the previous History record to the Query Window. To copy the SQL from the previous row Do one of the following: Select View > Previous SQL. Press F7. The new SQL replaces what was previously in the Query Window. Copying SQL from Next History Record to the Query Window You can copy the SQL from the next History record to the Query Window. To copy the SQL from the next row Do one of the following: Select View > Next SQL. Press F Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

143 Chapter 4: The History Window Using the History Window Selecting All History Rows The new SQL replaces what was previously in the Query Window. You can select all rows in the History window. To select all history rows Do one of the following: With the History window active, press Ctrl+A Click the top left header cell in the History table. Sorting the History Records There are two ways to sort the history locally: quick sort or full sort. Full Sort allows sorting of data in multiple columns. To sort history using quick sort Click the sort icon in any column header to sort the data by that column only. The data is initially sorted in ascending order. Clicking the sort icon again reverses the sort order. To sort history using full sort 1 Do one of the following: On the toolbar, click. Right-click in the History window, then select Sort. Select Edit > Sort. In the Sort dialog box, all columns in the active History window are presented in the Available Columns list. 2 Select the column name in the Available Columns list, and click the Add button. By default, the sort direction for this new sort column is ascending. Use the up or down icons to change the sort order. 3 To remove a sort column from the list, double-click the column name, or select it and press the Delete key or click the Remove button. You can also remove all columns from the Sort Keys list by pressing the Clear button. If you want to reset all the columns in the Sort Keys list back to the Available Columns list box, click Clear. 4 After you have selected the columns by which you want to sort and the direction in which you want to sort, click Sort. Teradata SQL Assistant for Microsoft Windows User Guide, Release

144 Chapter 4: The History Window Using the History Window Note: Sorting history the Seq (sequence number) column has exactly the same effect as sorting by date and time. However, it is considerably faster. Finding a Text String in the History Table You can find a specific text string in the History Table. To find text in the history grid 1 With the history table window active, select Edit > Find. Table 31: Find Dialog Box 2 Complete the following options: Option Description Find What Enter the desired text string, or select an existing text string. Match Case Search current column only Use wildcard characters ( * and?) Find Next Find All Select this checkbox to find text that matches the case of the search string. Clear this check box to search the entire spreadsheet. If multiple cells are selected, the current cell is marked with a bold outline. The default is selected, but the new setting is retained if it is changed. Note: Searches are faster when they are limited to a single column. Select this checkbox to treat any question mark symbol (?) and asterisk symbol (*) in the search string as a wildcard character. The question mark represents any single character. The asterisk represents any string of zero or more characters. Click to search for the next occurrence of the search string within the current grid. The search starts at the current cell position in the grid. Click to find all occurrences of the search string and display them in a listbox. Clicking an item in the list moves the selection in Answerset to the corresponding cell. The cell appears if necessary. Cleaning up the History Table Delete specific History rows by highlighting them in the History window and pressing the Delete button. 144 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

145 Chapter 4: The History Window Using the History Window Use the Cleanup History dialog box to delete a large number of rows. This dialog box allows you to specify which rows to delete based on criteria such as the Date on which the query was executed and the Data Source against which the query was executed. If multiple criteria are entered, only the rows matching all the criteria are deleted. This dialog box can also be used to delete all duplicate rows from the History table. Rows are considered to be duplicate if both the Data Source and the SQL Text are an exact match. This option is independent from the criteria specified above. Note: This function might take a long time if there are many rows in the History table. To Clean the History table 1 Select the History window. 2 Right-click in the History window and select Cleanup History. 3 Set the cleanup criteria as needed. Table 32 explains the available options. Table 32: Description of Cleanup History Options Cleanup History Option Date Data Source Description Enter a date or click the down arrow to display a calendar to select. Place a filter operator (>, <, =,) in the operator box. Enter a data source name. Teradata SQL Assistant for Microsoft Windows User Guide, Release

146 Chapter 4: The History Window Using the History Window Table 32: Description of Cleanup History Options (continued) Cleanup History Option User Name SQL Text Notes Queries that failed Rows with an empty Notes column Description Enter a user name. Enter text that appears within the SQL Text of the rows to be deleted. Note: See also Using Wildcard Characters with the History Filter on page 142. Enter text that appears within the Notes of the rows to be deleted. Note: See also Using Wildcard Characters with the History Filter on page 142. Select this check box to delete all rows that display an error code. Select this check box to delete all rows that do not have a Note assigned. Magnifying the History Window Use the following procedure to change the magnification of the contents of a window. To zoom the active window 1 Ensure the window is active. 2 Hold the Ctrl button and rotate the mouse wheel or press the + or - keys. Setting History Window Options You can control the History window by setting options. To set options 1 Select Tools > Options. 2 Click the History tab. The following table explains each option.[dr_ new screen capture below] 146 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

147 Chapter 4: The History Window Using the History Window Table 33: History Tab in the Options Dialog Box Option Record queries and metadata in the History Datebase Record file name in history when using Save As Do not save duplicate queries in History Display milliseconds in elapse time fields Display SQL text on a single line Show Tooltip when mouse over SQL column Description The default is selected. This option allows SQL statements to be inserted into the History table. They are also displayed in the History window whenever a query is submitted. When cleared, SQL queries are not logged. The default is cleared. Set this option to request that a record be added to the history file whenever you Save As query to a file. This record contains the date/time of the save operation together with the fully qualified name of the file that you saved. The default is cleared. When the option is selected, duplicate queries do not appear in the History window. Note: If the duplicate history row to be deleted contains a note, the note is copied to the new history row unless you have provided a new note when the query is executed. The default is not selected. If the option is selected, the elapse time field appears in milliseconds. The default is cleared. When this option is selected, SQL text displays on one line without carriage returns. The default is selected. This option allows the display of up to 500 characters of the SQL text when the mouse hovers over the SQL column in the History window. Teradata SQL Assistant for Microsoft Windows User Guide, Release

148 Chapter 4: The History Window Editing History Records Table 33: History Tab in the Options Dialog Box (continued) Option Require use of the Show History menu to close the history window Description When this option is selected, the application ignores attempts to close the window by clicking the close button at the top right of the window. This prevents accidentally closing History by clicking on the wrong window. Editing History Records Through the Edit History dialog box, history records can be viewed, edited, and deleted. You can also review all the information connected to a query. Many of the fields are read only, but you can edit the SQL text, notes, and results message. When the Edit History dialog box is first displayed, the current record is whichever cell and row is active (where you have placed your cursor) in the History window. If the History window is not open or no history record has been referenced, the current record is the last one added to the history database. This section provides the following information on editing history records: Displaying and Navigating the Edit History Dialog Box Editing a History Record Compacting History Adding or Change a Note in a History Record Displaying and Navigating the Edit History Dialog Box To display the Edit History dialog box 1 Do one of the following: Select Tools > Edit History. Right-click in the History window and select Edit. Double-click the row to be edited anywhere except in the Notes cell. 2 To navigate through the history records, use the arrow buttons the bottom center of the dialog box. The outer buttons take you to the first or last record in the history database. The inner buttons take you to the next or previous record. 148 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

149 Chapter 4: The History Window Saving, Copying, and Printing History Editing a History Record Compacting History To edit a history record 1 Double-click the row to be edited. 2 Within the Edit History dialog box, edit the contents of the following fields: SQL text Notes Result message 3 Do one of the following: To commit the change, click the icon. To cancel the change, click the icon. You can also double-click in the Notes cell of a row in the History window. The Query Note dialog box opens so you can add or change a note. Periodically, you can clean up the current history file to reclaim space that might have been lost when history rows were deleted. To compact history Select Tools > Compact History. Adding or Change a Note in a History Record You can add or change the note associated with a history record. To add or change a note in a history record 1 Double-click in the Notes cell of a row in the History window. 2 In the Query Note dialog box, enter the new note information. Saving, Copying, and Printing History From the History window, you can save a specific part of the data by highlighting the part you want to save. If no part of the History window is highlighted, the entire contents is saved. You cannot reload a saved history file into a new History window. There is only one History window and that is loaded from the history database. This section provides the following information: Teradata SQL Assistant for Microsoft Windows User Guide, Release

150 Chapter 4: The History Window Saving, Copying, and Printing History Saving History Rows Copying Rows to the Clipboard Copying Rows to Notepad Printing the Contents of the History Window Cancelling Print Jobs Saving History Rows To save history rows 1 Ensure the History window is active. 2 Do one of the following: On the toolbar, click. From the File menu, click Save History As. Press Ctrl+S. 3 In the Save History dialog box, enter a file name and select a format type. See File Format Types below. 4 Select a location and click Save. File Format Types You can save the history in the following formats: Table 34: History File Format Types File Type Tab delimited [ANSI} Tab Delimited [Unicode] Tab delimited [UTF-8] Delimited Text [ANSI] Description The data is saved in a tab-delimited file using ANSI. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved in a tab-delimited file using Unicode. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved in a tab-delimited file using UTF-8. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved is a delimited text file using ANSI. To set the use of quotes or to set the delimiter between columns, see Setting Export/Import Options on page 131. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. 150 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

151 Chapter 4: The History Window Saving, Copying, and Printing History Table 34: History File Format Types (continued) File Type Delimited Text [Unicode] Delimited Text [UTF-8] Microsoft Excel 2003 Microsoft Excel 2007 PDF Document [*.pdf] Web Page [*htm] XML Document Description The data is saved is a delimited text file using Unicode. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved is a delimited text file using UTF-8. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The column headings are saved only if they are visible on the screen. The data is saved as an Excel 2003 workbook containing one data sheet. The entire Answerset is saved. Column and row headers are saved if they are currently visible. The data is saved as an Excel 2007 workbook containing one data sheet. The entire Answerset is saved. Column and row headers are saved if they are currently visible. The data is saved as a PDF file. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The data is saved as a table in HTML. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. The data is saved as an XML document. No special formatting is retained. If a block of cells is selected, only that block is saved. If no part of the spreadsheet is selected, the entire Answerset is saved. Copying Rows to the Clipboard You can copy rows from the History window to the Clipboard. To copy rows to Clipboard 1 Highlight the rows you would like to copy from the History window by clicking and dragging your mouse anywhere within a row or column. 2 Do one of the following: On the toolbar, click. From the Edit menu, select Copy. Right-click and select Copy. Copying Rows to Notepad You can copy rows from the History window to Notepad. Teradata SQL Assistant for Microsoft Windows User Guide, Release

152 Chapter 4: The History Window Storing History Files To copy rows to Notepad 1 Highlight the rows you would like to copy from the History window by clicking and dragging your mouse anywhere within a row or column. 2 Select File > Copy to Notepad. Printing the Contents of the History Window To print the contents of the History window 1 Click the History window to make it active. 2 Do one of the following: On the toolbar, click. From the File menu, click Print. Press Ctrl+P. Note: Use Print Preview to preview the job before printing. 3 The standard Windows Print dialog box appears 4 Do one of the following: To print the entire History table: Under Print Range, select All. To print a partial section of the History table: a Highlight the History cells, columns, or rows you want to print. b Under Print Range, select Selection. Cancelling Print Jobs You can cancel print jobs through the Print Manager. To cancel a print job 1 On your desktop, click Start and select Printers and Faxes. 2 Double-click your printer. 3 In the printer window, select Document > Cancel. Storing History Files By default, history files are stored at: \Documents and Settings\<username>Application Data\Teradata\SQL Assistant. 152 Teradata SQL Assistant for Microsoft Windows User Guide, Release 15.10

153 Chapter 4: The History Window Storing History Files However, you can store them in the same location as your other Microsoft Access databases or other data files. Changing the Location of History Files To change the location used to store history files 1 Select Tools > Options. 2 Click the File Path tab. Note: History files can be stored locally or on the network. 3 In the History File box, click the browse button to select a file location.[dr_ new screen capture below] If you currently have the History window open, the data in this window is replaced by that contained in the history file in this new location. If the new location does not contain a history file, one is created for you. Teradata SQL Assistant for Microsoft Windows User Guide, Release

Teradata Administrator. User Guide

Teradata Administrator. User Guide Teradata Administrator User Guide Release 15.10 B035-2502-035K March 2015 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

Teradata Administrator. User Guide

Teradata Administrator. User Guide Teradata Administrator User Guide Release 14.10 B035-2502-082K March 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

Teradata Aster Database Drivers and Utilities Support Matrix

Teradata Aster Database Drivers and Utilities Support Matrix Teradata Aster Database Drivers and Utilities Support Matrix Versions AD 6.20.04 and AC 7.00 Product ID: B700-6065-620K Published: May 2017 Contents Introduction... 1 Aster Database and Client Compatibility

More information

Unity Ecosystem Manager. Release Definition

Unity Ecosystem Manager. Release Definition Unity Ecosystem Manager Release Definition Release 14.10 B035-3200-014C January 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata BAR Backup Application Software Release Definition

Teradata BAR Backup Application Software Release Definition What would you do if you knew? Teradata BAR Backup Application Software Release Definition Teradata Appliance Backup Utility Teradata Extension for NetBackup Teradata Extension for Tivoli Storage Manager

More information

Hortonworks Data Platform for Teradata Installation, Configuration, and Upgrade Guide for Customers Release 2.3, 2.4 B K March 2016

Hortonworks Data Platform for Teradata Installation, Configuration, and Upgrade Guide for Customers Release 2.3, 2.4 B K March 2016 What would you do if you knew? Hortonworks Data Platform for Teradata Installation, Configuration, and Upgrade Guide for Customers Release 2.3, 2.4 B035-6036-075K March 2016 The product or products described

More information

What would you do if you knew? Hortonworks Data Platform for Teradata Release Definition Release 2.3 B C July 2015

What would you do if you knew? Hortonworks Data Platform for Teradata Release Definition Release 2.3 B C July 2015 What would you do if you knew? Hortonworks Data Platform for Teradata Release Definition Release 2.3 B035-6034-075C July 2015 The product or products described in this book are licensed products of Teradata

More information

Teradata Parallel Transporter. Quick Start Guide

Teradata Parallel Transporter. Quick Start Guide Teradata Parallel Transporter Quick Start Guide Release 15.00 B035-2501-034K March 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Aster Database Platform/OS Support Matrix, version 6.10

Aster Database Platform/OS Support Matrix, version 6.10 Aster Database Platform/OS Support Matrix, version 6.10 Versions AD6.10 Product ID: B700-6041-610K Published on December 2015 Contents Introduction... 2 Support for Teradata Aster MapReduce Appliance 2...

More information

Teradata Schema Workbench. Release Definition

Teradata Schema Workbench. Release Definition Teradata Schema Workbench Release Definition Release 14.10 B035-4108-053C September 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Visual Explain. User Guide

Teradata Visual Explain. User Guide Teradata Visual Explain User Guide Release 14.00 B035-2504-071A November 2011 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

Aster Express Getting Started Guide

Aster Express Getting Started Guide Aster Express Getting Started Guide Release Number 6.10 Product ID: B700-6082-610K May 2016 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata OLAP Connector. Release Definition

Teradata OLAP Connector. Release Definition Teradata OLAP Connector Release Definition Release 14.10 B035-4107-053C September 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Query Scheduler. User Guide

Teradata Query Scheduler. User Guide Teradata Query Scheduler User Guide Release 12.00.00 B035-2512-067A July 2007 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET,

More information

Teradata Aster Database Platform/OS Support Matrix, version AD

Teradata Aster Database Platform/OS Support Matrix, version AD Teradata Aster Database Platform/OS Support Matrix, version AD6.20.04 Product ID: B700-6042-620K Published: March 2017 Contents Introduction... 2 Support for Teradata Aster Big Analytics Appliance 3 and

More information

What would you do if you knew?

What would you do if you knew? What would you do if you knew? Teradata Data Lab User Guide Release 15.10 B035-2212-035K March 2015 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

What would you do if you knew? Teradata Debugger for C/C++ UDF User Guide Release B K January 2016

What would you do if you knew? Teradata Debugger for C/C++ UDF User Guide Release B K January 2016 What would you do if you knew? Teradata Debugger for C/C++ UDF User Guide Release 15.10 B035-2070-016K January 2016 The product or products described in this book are licensed products of Teradata Corporation

More information

Teradata Business Intelligence Optimizer. Release Definition

Teradata Business Intelligence Optimizer. Release Definition Teradata Business Intelligence Optimizer Release Definition Release 13.10 B035-4104-051C May 2011 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Query Scheduler. Administrator Guide

Teradata Query Scheduler. Administrator Guide Teradata Query Scheduler Administrator Guide Release 14.00 B035-2511-071A August 2011 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Aster Database Drivers and Utilities Support Matrix

Aster Database Drivers and Utilities Support Matrix Aster Database s and Utilities Support Matrix Versions AD and AC Product ID: B700-2002-510K Revision 4 published on 9/4/2013 Contents Introduction... 1 Aster Database and Client Compatibility Matrix...

More information

Aster Database Platform/OS Support Matrix, version 5.0.2

Aster Database Platform/OS Support Matrix, version 5.0.2 Aster Database Platform/OS Support Matrix, version 5.0.2 Contents Introduction... 2 Support for Teradata Aster MapReduce Appliance 2... 2 Support for Teradata Aster Big Analytics Appliance 3H... 2 Teradata

More information

Teradata Studio and Studio Express Installation Guide

Teradata Studio and Studio Express Installation Guide What would you do if you knew? Installation Guide Release 16.10 B035-2037-067K June 2017 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Aster Database Platform/OS Support Matrix, version 6.00

Aster Database Platform/OS Support Matrix, version 6.00 Aster Database Platform/OS Support Matrix, version 6.00 Versions AD6.00 Product ID: B700-6042-600K First Published on 12/18/2013 Contents Introduction... 2 Support for Teradata Aster MapReduce Appliance

More information

Teradata Schema Workbench. User Guide

Teradata Schema Workbench. User Guide Teradata Schema Workbench User Guide Release 15.00 B035-4106-034K June 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

Aster Development Environment. User Guide

Aster Development Environment. User Guide Aster Development Environment User Guide Release Number 6.00 Product ID: B700-6031-600K September 2014 The product or products described in this book are licensed products of Teradata Corporation or its

More information

Aster Development Environment. User Guide

Aster Development Environment. User Guide Aster Development Environment User Guide Release Number 5.10 Product ID: B700-6030-510K May 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Extension for NetBackup. Administrator Guide

Teradata Extension for NetBackup. Administrator Guide Teradata Extension for NetBackup Administrator Guide Release 15.10 B035-2400-035K March 2015 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Parallel Transporter. Reference

Teradata Parallel Transporter. Reference Teradata Parallel Transporter Reference Release 14.00 B035-2436-071A June 2012 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Studio User Guide

Teradata Studio User Guide What would you do if you knew? Teradata Studio User Guide Release 16.00 B035-2041-126K March 2017 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Aster Client 6.22 Release Notes

Teradata Aster Client 6.22 Release Notes Teradata Aster Client 6.22 Release Notes Product ID: B700-2003-622K Released: May, 2017 Aster Client version: 6.22 Summary This document describes the new features and enhancements in the AC 6.22 and AC

More information

Teradata Aggregate Designer. User Guide

Teradata Aggregate Designer. User Guide Teradata Aggregate Designer User Guide Release 14.00 B035-4103-032A June 2012 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

ODBC Driver for Teradata. User Guide

ODBC Driver for Teradata. User Guide ODBC Driver for Teradata User Guide Release 16.00 B035-2509-086K November 2016 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Schema Workbench. User Guide

Teradata Schema Workbench. User Guide Teradata Schema Workbench User Guide Release 14.10 B035-4106-053K September 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Tools and Utilities. Installation Guide for Microsoft Windows

Teradata Tools and Utilities. Installation Guide for Microsoft Windows Teradata Tools and Utilities Installation Guide for Microsoft Windows Release 12.00.00 B035-2407-067A September 2007 The product or products described in this book are licensed products of Teradata Corporation

More information

Teradata Workload Analyzer. User Guide

Teradata Workload Analyzer. User Guide Teradata Workload Analyzer User Guide Release 14.10 B035-2514-082K March 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

What would you do if you knew? Teradata Database Nodes Preparing to Move from SLES 10 to SLES 11 B K April 2015

What would you do if you knew? Teradata Database Nodes Preparing to Move from SLES 10 to SLES 11 B K April 2015 What would you do if you knew? Teradata Database Nodes Preparing to Move from SLES 10 to SLES 11 B035-5970-124K April 2015 The product or products described in this book are licensed products of Teradata

More information

Teradata Workload Analyzer. User Guide

Teradata Workload Analyzer. User Guide Teradata Workload Analyzer User Guide Release 16.00 B035-2514-086K November 2016 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Parallel Transporter. User Guide

Teradata Parallel Transporter. User Guide Teradata Parallel Transporter User Guide Release 12.0 B035-2445-067A July 2007 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Basic Teradata Query. Reference

Basic Teradata Query. Reference Basic Teradata Query Reference Release 15.10 B035-2414-035K March 2015 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active Data

More information

Basic Teradata Query. Reference

Basic Teradata Query. Reference Basic Teradata Query Reference Release 14.10 B035-2414-082K November 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active

More information

Unity Data Mover Release Definition Release B C April 2014

Unity Data Mover Release Definition Release B C April 2014 Release Definition Release 14.11 B035-4100-044C April 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active Data Warehousing,

More information

Teradata Preprocessor2 for Embedded SQL. Programmer Guide

Teradata Preprocessor2 for Embedded SQL. Programmer Guide Teradata Preprocessor2 for Embedded SQL Programmer Guide Release 14.10 B035-2446-082K March 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Tools and Utilities. Installation Guide for UNIX and Linux

Teradata Tools and Utilities. Installation Guide for UNIX and Linux Teradata Tools and Utilities Installation Guide for UNIX and Linux Release 12.00.00 B035-2459-067A September 2007 The product or products described in this book are licensed products of Teradata Corporation

More information

Aprimo Marketing Studio Configuration Mover Guide

Aprimo Marketing Studio Configuration Mover Guide Aprimo Marketing Studio 9.0.1 Configuration Mover Guide The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Aprimo and Teradata are registered

More information

Teradata Call-Level Interface Version 2. Reference for Network-Attached Systems

Teradata Call-Level Interface Version 2. Reference for Network-Attached Systems Teradata Call-Level Interface Version 2 Reference for Network-Attached Systems Release 13.00.00 B035-2418-088A April 2009 The product or products described in this book are licensed products of Teradata

More information

What would you do if you knew? Teradata ODBC Driver for Presto Installation and Configuration Guide Release B K October 2016

What would you do if you knew? Teradata ODBC Driver for Presto Installation and Configuration Guide Release B K October 2016 What would you do if you knew? Teradata ODBC Driver for Presto Installation and Configuration Guide Release 1.1.4 B035-6060-106K October 2016 The product or products described in this book are licensed

More information

Teradata Studio, Studio Express and Plug-in for Eclipse Release Definition Release B C November 2015

Teradata Studio, Studio Express and Plug-in for Eclipse Release Definition Release B C November 2015 What would you do if you knew? Teradata Studio, Studio Express and Plug-in for Eclipse Release Definition Release 15.10.01 B035-2040-045C November 2015 The product or products described in this book are

More information

What would you do if you knew? Teradata ODBC Driver for Presto Installation and Configuration Guide Release December 2015

What would you do if you knew? Teradata ODBC Driver for Presto Installation and Configuration Guide Release December 2015 What would you do if you knew? Teradata ODBC Driver for Presto Installation and Configuration Guide Release 1.0.0 December 2015 The product or products described in this book are licensed products of Teradata

More information

Teradata Tools and Utilities. Release Definition

Teradata Tools and Utilities. Release Definition Teradata Tools and Utilities Release Definition Release 14.10 B035-2029-082C November 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Database. SQL Data Control Language

Teradata Database. SQL Data Control Language Teradata Database SQL Data Control Language Release 14.0 B035-1149-111A June 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Replication Services Using Oracle GoldenGate

Teradata Replication Services Using Oracle GoldenGate Teradata Replication Services Using Oracle GoldenGate Release 12.0 B035-1152-067A July 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

IBM CICS Interface for Teradata. Reference

IBM CICS Interface for Teradata. Reference IBM CICS Interface for Teradata Reference Release 15.10 B035-2448-035K March 2015 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata OLAP Server. User Guide

Teradata OLAP Server. User Guide Teradata OLAP Server User Guide Release 15.00 B035-4109-034K June 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active Data

More information

Teradata JSON Release B K December 2015

Teradata JSON Release B K December 2015 What would you do if you knew? Teradata Database Teradata JSON Release 15.10 B035-1150-151K December 2015 The product or products described in this book are licensed products of Teradata Corporation or

More information

Teradata Database. Teradata Replication Services Using Oracle GoldenGate

Teradata Database. Teradata Replication Services Using Oracle GoldenGate Teradata Database Teradata Replication Services Using Oracle GoldenGate Release 13.0 B035-1152-098A April 2011 The product or products described in this book are licensed products of Teradata Corporation

More information

Teradata Studio, Studio Express, and Plug-in for Eclipse Installation Guide

Teradata Studio, Studio Express, and Plug-in for Eclipse Installation Guide What would you do if you knew? Teradata Studio, Studio Express, and Plug-in for Eclipse Installation Guide Release 15.12 B035-2037-086K August 2016 The product or products described in this book are licensed

More information

What would you do if you knew? Teradata Data Warehouse Appliance 2750 Platform Hardware Replacement Guide for Customers B K February 2016

What would you do if you knew? Teradata Data Warehouse Appliance 2750 Platform Hardware Replacement Guide for Customers B K February 2016 What would you do if you knew? Teradata Data Warehouse Appliance 2750 Platform Hardware Replacement Guide for Customers B035-5545-103K February 2016 The product or products described in this book are licensed

More information

Teradata ServiceConnect Enhanced Policy Server Installation and Configuration Guide. Powered by Axeda

Teradata ServiceConnect Enhanced Policy Server Installation and Configuration Guide. Powered by Axeda Teradata ServiceConnect Enhanced Policy Server Installation and Configuration Guide Powered by Axeda B035-5374-022K October 2012 The product or products described in this book are licensed products of

More information

What would you do if you knew?

What would you do if you knew? What would you do if you knew? Teradata Database Support Utilities Release 16.00 B035-1180-160K December 2016 The product or products described in this book are licensed products of Teradata Corporation

More information

What would you do if you knew? Teradata JDBC Driver for Presto Installation and Configuration Guide Release B K May 2016

What would you do if you knew? Teradata JDBC Driver for Presto Installation and Configuration Guide Release B K May 2016 What would you do if you knew? Teradata JDBC Driver for Presto Release 1.0.0 B035-6068-056K May 2016 The product or products described in this book are licensed products of Teradata Corporation or its

More information

Teradata Extension for Tivoli Storage Manager. Administrator Guide

Teradata Extension for Tivoli Storage Manager. Administrator Guide Teradata Extension for Tivoli Storage Manager Administrator Guide Release 13.01 B035-2444-020A April 2010 The product or products described in this book are licensed products of Teradata Corporation or

More information

Teradata Database. SQL Reference. Stored Procedures and Embedded SQL

Teradata Database. SQL Reference. Stored Procedures and Embedded SQL Teradata Database SQL Reference Stored Procedures and Embedded SQL Release V2R6.2 B035-1148-096A September 2006 The product described in this book is a licensed product of Teradata, a division of NCR Corporation.

More information

Teradata Studio Express

Teradata Studio Express Teradata Studio Express User Guide Release 16.20 April 2018 B035-2042-518K Copyright and Trademarks Copyright 2006-2018 by Teradata. All Rights Reserved. All copyrights and trademarks used in Teradata

More information

Teradata Query Director. User Guide

Teradata Query Director. User Guide Teradata Query Director User Guide Release 12.00.00 B035-2510-067A August 2007 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata FastLoad. Reference

Teradata FastLoad. Reference Teradata FastLoad Reference Release 13.00.00 B035-2411-088A April 2009 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET, DBC/1012,

More information

Teradata Alerts Installation, Configuration, and Upgrade Guide Release B K March 2014

Teradata Alerts Installation, Configuration, and Upgrade Guide Release B K March 2014 Teradata Alerts Installation, Configuration, and Upgrade Guide Release 15.00 B035-2211-034K March 2014 The product or products described in this book are licensed products of Teradata Corporation or its

More information

Basic Teradata Query. Reference

Basic Teradata Query. Reference Basic Teradata Query Reference Release 13.10 B035-2414-020A August 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET,

More information

Teradata Tools and Utilities for Microsoft Windows Installation Guide

Teradata Tools and Utilities for Microsoft Windows Installation Guide What would you do if you knew? Teradata Tools and Utilities for Microsoft Windows Installation Guide Release 16.20 B035-2407-117K November 2017 The product or products described in this book are licensed

More information

Teradata Database on AWS Getting Started Guide

Teradata Database on AWS Getting Started Guide What would you do if you knew? Teradata Database on AWS Getting Started Guide B035-2800-036K November 2016 The product or products described in this book are licensed products of Teradata Corporation or

More information

Teradata Profiler. Plug-in for Eclipse User Guide

Teradata Profiler. Plug-in for Eclipse User Guide Teradata Profiler Plug-in for Eclipse User Guide Release 15.0 B035-2304-064A June 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Aster R User Guide

Teradata Aster R User Guide Teradata Aster R User Guide Release Number: 6.20 Product ID: B700-2010-620K September, 2015 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Electronic Software Distribution Guide

Electronic Software Distribution Guide What would you do if you knew? Electronic Software Distribution Guide BCDO-0718-0000 July 2017 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Preprocessor2 for Embedded SQL. Programmer Guide

Teradata Preprocessor2 for Embedded SQL. Programmer Guide Teradata Preprocessor2 for Embedded SQL Programmer Guide Release 13.10 B035-2446-020A August 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Database. Resource Usage Macros and Tables

Teradata Database. Resource Usage Macros and Tables Teradata Database Resource Usage Macros and Tables Release 14.10 B035-1099-112A August 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

User's Guide c-treeace Performance Monitor

User's Guide c-treeace Performance Monitor User's Guide c-treeace Performance Monitor Contents 1. c-treeace Performance Monitor... 3 1.1 Startup... 4 1.2 Using Main Window... 5 1.3 Menus... 7 1.4 Icon Row... 10 1.5 Configuration Options... 11 2.

More information

Teradata Aster Analytics on Azure Getting Started Guide

Teradata Aster Analytics on Azure Getting Started Guide What would you do if you knew? Teradata Aster Analytics on Azure Getting Started Guide Release AD B700-3040-620K May 2017 The product or products described in this book are licensed products of Teradata

More information

End User s Guide Release 5.0

End User s Guide Release 5.0 [1]Oracle Application Express End User s Guide Release 5.0 E39146-04 August 2015 Oracle Application Express End User's Guide, Release 5.0 E39146-04 Copyright 2012, 2015, Oracle and/or its affiliates. All

More information

Teradata Database. Resource Usage Macros and Tables

Teradata Database. Resource Usage Macros and Tables Teradata Database Resource Usage Macros and Tables Release 14.0 B035-1099-111A September 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Data Warehouse Appliance Platform Product and Site Preparation Quick Reference B K May 2011

Teradata Data Warehouse Appliance Platform Product and Site Preparation Quick Reference B K May 2011 Teradata Data Warehouse Appliance 2650 Platform Product and Site Preparation B035-5439-051K May 2011 The product or products described in this book are licensed products of Teradata Corporation or its

More information

01.15 EB6120 PROFITABILITY ANALYTICS. Teradata Value Analyzer

01.15 EB6120 PROFITABILITY ANALYTICS. Teradata Value Analyzer 01.15 EB6120 PROFITABILITY ANALYTICS Teradata Value Analyzer Table of Contents 2 Executive Overview 3 Purpose and Process 3 Client Data Sources 4 General Components 6 Summary of Data Sources and Uses 8

More information

Teradata Database. Resource Usage Macros and Tables

Teradata Database. Resource Usage Macros and Tables Teradata Database Resource Usage Macros and Tables Release 13. B35-199-98A October 211 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Linux, Windows Server 2003, MP-RAS

Linux, Windows Server 2003, MP-RAS What would you do if you knew? Teradata Database Node Software Upgrade Guide: Overview and Preparation Linux, Windows Server 2003, MP-RAS Release 14.0 and Later B035-5921-161K July 2017 The product or

More information

User's Guide c-treeace Query Builder

User's Guide c-treeace Query Builder User's Guide c-treeace Query Builder User's Guide c-treeace Query Builder Contents 1. c-treeace Query Builder... 4 1.1 Startup... 5 1.2 Securing Your Connection with SSL... 6 1.3 Main Window... 7 1.4 Query

More information

Operating Instructions

Operating Instructions Operating Instructions Software (Network Configuration and ) For Digital Imaging Systems Opening Configuration/ System Requirements General Description Before using this software, please carefully read

More information

SQL Studio (BC) HELP.BCDBADASQL_72. Release 4.6C

SQL Studio (BC) HELP.BCDBADASQL_72. Release 4.6C HELP.BCDBADASQL_72 Release 4.6C SAP AG Copyright Copyright 2001 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express

More information

Teradata Virtual Machine Developer Edition Installation, Configuration, and Upgrade Guide Release B K April 2016

Teradata Virtual Machine Developer Edition Installation, Configuration, and Upgrade Guide Release B K April 2016 What would you do if you knew? Teradata Virtual Machine Developer Edition Installation, Configuration, and Upgrade Guide Release 15.10 B035-5938-046K April 2016 The product or products described in this

More information

Oracle Enterprise Performance Reporting Cloud. What s New in the November Update (16.11)

Oracle Enterprise Performance Reporting Cloud. What s New in the November Update (16.11) Oracle Enterprise Performance Reporting Cloud What s New in the November Update (16.11) November 2016 TABLE OF CONTENTS REVISION HISTORY... 3 ORACLE ENTERPRISE PERFORMANCE REPORTING CLOUD, NOVEMBER UPDATE...

More information

HP Database Manager (HPDM) User Guide

HP Database Manager (HPDM) User Guide HP Database Manager (HPDM) User Guide HP Part Number: 597527-001 Published: March 2010 Edition: HP Neoview Release 2.4 Service Pack 2 Copyright 2010 Hewlett-Packard Development Company, L.P. Legal Notice

More information

Teradata Virtual Machine Base Edition Installation, Configuration, and Upgrade Guide Release B K April 2016

Teradata Virtual Machine Base Edition Installation, Configuration, and Upgrade Guide Release B K April 2016 What would you do if you knew? Teradata Virtual Machine Base Edition Installation, Configuration, and Upgrade Guide Release 15.10 B035-5945-046K April 2016 The product or products described in this book

More information

What would you do if you knew? Teradata Viewpoint Installation, Configuration, and Upgrade Guide for Customers Release B K May 2015

What would you do if you knew? Teradata Viewpoint Installation, Configuration, and Upgrade Guide for Customers Release B K May 2015 What would you do if you knew? Teradata Viewpoint Installation, Configuration, and Upgrade Guide for Customers Release 15.10 B035-2207-035K May 2015 The product or products described in this book are licensed

More information

Teradata JDBC Driver for Presto Installation and Configuration Guide

Teradata JDBC Driver for Presto Installation and Configuration Guide What would you do if you knew? Teradata JDBC Driver for Presto Installation and Configuration Guide Release 1.0.12 B035-6068-126K December 2016 The product or products described in this book are licensed

More information

Teradata System Emulation Tool

Teradata System Emulation Tool Teradata Tools and Utilities Teradata System Emulation Tool User Guide Release 16.20 April 2018 B035-2492-048K Copyright and Trademarks Copyright 2002-2018 by Teradata. All Rights Reserved. All copyrights

More information

Teradata Database. SQL Data Control Language

Teradata Database. SQL Data Control Language Teradata Database SQL Data Control Language Release 13.10 B035-1149-109A August 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Dell One Identity Manager Administration Guide for Connecting to SharePoint

Dell One Identity Manager Administration Guide for Connecting to SharePoint Dell One Identity Manager 7.1.3 Administration Guide for Connecting to SharePoint 2016 Dell Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property

More information

Teradata Database on VMware Enterprise Edition Getting Started Guide

Teradata Database on VMware Enterprise Edition Getting Started Guide What would you do if you knew? Teradata Database on VMware Enterprise Edition Getting Started Guide B035-5945-086K November 2016 The product or products described in this book are licensed products of

More information

Aster Database Installation and Upgrade Guide

Aster Database Installation and Upgrade Guide Aster Database Installation and Upgrade Guide Release Number 6.10 Product ID: B700-6023-610K December 2015 The product or products described in this book are licensed products of Teradata Corporation or

More information

Teradata Parallel Transporter

Teradata Parallel Transporter Teradata Tools and Utilities Teradata Parallel Transporter Quick Start Guide Release 16.20 April 2018 B035-2501-048K Copyright and Trademarks Copyright 1999-2018 by Teradata. All Rights Reserved. All copyrights

More information

Teradata Virtual Storage. Release 14.0 B A January 2012

Teradata Virtual Storage. Release 14.0 B A January 2012 Teradata Virtual Storage Release 14.0 B035-1179-111A January 2012 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active Enterprise

More information

Introduction to SAP BusinessObjects Dashboards

Introduction to SAP BusinessObjects Dashboards Introduction to SAP BusinessObjects Dashboards Page 2 of 6 Copyright Copyright 2012 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose

More information

User's Guide c-treeace Replication Monitor

User's Guide c-treeace Replication Monitor User's Guide c-treeace Replication Monitor Copyright Notice Copyright 1992-2018 FairCom Corporation. All rights reserved. No part of this publication may be stored in a retrieval system, or transmitted

More information