ToadDataPoint 6.4 UserGuide
ToadDataPoint 6.4 UserGuide
User Guide
Copyright
Copyright 2
Contents 3
Introduction 6
About Toad Data Point 6
Best Practices 7
Understand Toad's Workflow 8
Connect 9
Create Amazon Redshift Connections 9
Create ODBC Connections 10
Tips for Working with ODBC Connections 12
ODBC Features 12
Create Oracle Connections 12
Client Connection or Direct Connection 12
Configure the Oracle Instant Client 13
Create an Oracle Connection 13
Create Snowflake Connections 15
Authentication Notes 16
Limitations of Snowflake Native Connections 17
Create SQL Server and SQL Azure Connections 17
Microsoft SQL Azure Connections with Multi-factor Authentication 19
Limitations of Microsoft SQL Azure connections with Multi-factor Authentication 20
Create SharePoint Connections 20
SharePoint Connections with Multi-factor Authentication 21
Limitations of SharePoint connections with Multi-factor Authentication 22
Understand Toad Connections 23
Toad Open Connections 23
Sharing a Connection Among Windows 23
Troubleshoot SQL Server® Issues 24
Connection Issues 24
Create Databricks Connections 25
Understand 27
Determine the Best Method to Locate Objects 27
Object Explorer 27
Filter Databases and Objects 28
Types of Filters 28
Before Creating a Filter 29
Create Filters 29
Use Filters 30
Query 38
Tutorial: Visually Build a Query 38
Create Cross-Connection Queries 40
Considerations and Limitations of Cross-Connection Queries 41
Reverse Engineer Queries 42
Considerations and Limitations in the Query Builder 42
Tutorial: Build a Subquery 44
Using Bind Variables 47
Use Quote Function to Substitute a String at Run Time 59
About Editing SQL 59
Configure Editor Options 61
Editor Shortcut Keys 61
View Result Sets 64
Visual Inspection Grid 64
Troubleshoot Data 64
Tips for Working with Data 64
Compare Differences in Data 66
Export Data with One Click Export 66
Share Excel Linked Queries 68
Publish Data to Intelligence Central 69
About Publishing Data 69
Prepare to Publish Data to Toad Intelligence Central 70
Publish to Toad Intelligence Central 72
Destination Database in Toad Intelligence Central 76
Variables in Views/Scripts and Publishing to Intelligence Central 78
Considerations and Limitations when Publishing to Intelligence Central 80
Publishing from Excel or Local Storage 83
Troubleshoot Publishing to Toad Intelligence Central 83
Report 86
Tutorial: Create a Toad Data Report 86
Step 1: Run the Toad Data Report Wizard 86
Step 2: Update Fields 87
Step 3: Use Styles to Format the Report Appearance 87
Step 4: Update Bands and Add Controls 89
Manage Reports 90
About Managing Reports 90
DB2 Reports 91
MySQL Reports 93
ODBC Reports 93
Oracle Reports 93
SQL Server Reports 95
Publish and Share Reports 97
How to configure Toad to use Auth for sending SMTP Emails 133
About Us 138
Contact Quest 138
Technical Support Resources 138
Index 139
Toad® Data Point is a multi-platform database query tool built for anyone who needs to access data, understand
data relationships, and quickly produce reports.
With Toad Data Point, you can:
l Connect to almost any database or ODBC data source (see the Release Notes for a list of tested ODBC
connections)
l Write SQL queries and join data across all platforms
l Automate and schedule frequent and repetitive tasks
l Streamline data collection
l Collaborate with team members
l Export data in a variety of file formats
Toad Data Point provides a full-featured Database Explorer, Query Builder, and Editor for the following databases:
l Oracle®
l SQL Server® and SQL Azure
l IBM® DB2® (LUW and z/OS)
l SAP® ASE, IQ, SQL Anywhere, and HANA
l Teradata®
l MySQL
l Snowflake®
l Databricks
Toad Data Point also provides querying and reporting functionality via the following provider types:
l ODBC
l Business Intelligence and NoSQL data sources
l Microsoft® Excel®
l Microsoft Access®
ODBC Connections
The purpose of the ODBC provider is to offer basic connection and querying capabilities to any database that
supports an ODBC 3.0 or later driver. For a list of databases tested with the ODBC provider, see the System
Requirements in the Release Notes. This form of connectivity allows connections to databases such as Netezza,
Business Oracle Business Intelligence Enterprise Edition (OBIEE), SAP Business Objects™,
Intelligence Salesforce®, Microsoft SQL Server Analysis Services, Google Analytics™, OData, and
SharePoint®
NoSQL Azure Table Services, Cassandra™, Cloudera Impala, DynamoDB, HBASE™, Hive™,
MongoDB™
Best Practices
Toad provides tools that help you succeed in your query and reporting goals. Many of these tools are considered
Best Practices and are beneficial for individual users as well as managers. The following table describes the
benefits of using Toad to improve Best Practices:
Note: You must have Amazon Redshift ODBC driver 1.3.1.1000 (or later) installed before a native
connection is created.
4. Click Connect to save the connection and immediately connect to the database or click Save to save the
Tip: Connections are stored in the connections.xml file and can be found by clicking the Application Data Directory
link in Help | About.
4. To create a data source to use in this connection, click in the Data Source Name field. Then click Add.
Notes:
l If you have an Oracle database with Unicode data, make sure to select Force SQL_WCHAR Support
on the Workarounds tab of the windows Oracle ODBC Configuration dialog. If you do not, you will not
be able to see the data.
l If creating a MySQL ODBC connection to use in a cross-connection query, you must specify a
database in the Windows MySQL ODBC Configuration dialog.
7. Specify the connection properties in the Create New Connection dialog. Review the following for additional
information:
General
Data source Select the driver or data source name you added in the previous steps.
name
User Enter the user name to use when connecting.
Password Enter the password to use when connecting.
Tip: After connecting, you can set a master password to further secure your
connection in Tools | Options| Environment | Security.
Database Select a database or schema. Click to create a temporary connection and
display available databases/schemas in the drop-down list.
Information
Data Source Displays the selected driver or data source name.
Name
Driver Displays the ODBC driver associated with the data source.
Advanced
Default Table Specify default options to use when creating a new table.
Column Column type—Select the default data type to use when creating a table.
Column length—For the selected column type, enter a default column length to
use.
Advanced Options Block Cursor Size—Specify the number of rows to return in a single fetch of data
from the result set.
Disable multi-threading—Multi-threading is disabled by default. Enable multi-
threading only if supported by the driver. Multi-threading can improve performance,
but can also result in unpredictable behavior if not supported by the driver.
Default: Selected
Category (Optional) Select an existing category or create a new one.
ODBC Features
Feature Description
Bypass schema/instance For ODBC connections, in the SQL Editor you can bypass selecting a
selection in SQL Editor schema/instance and specify this information through the script instead. This is
useful if your script executes SQL against multiple schemas.
To use this method, select I will set schema/instance in the script from the
schema/instance drop-down list in the SQL Editor window. Then specify the
schema/instance through your script.
Note: When this option is selected, some code completion features, object
actions, and object information tool tips are unavailable for this SQL Editor
window.
Click here to view a video about creating connections in Toad Data Point
5. To use the Oracle Instant Client connection in a cross-connection query, you must also install an
Oracle ODBC driver. (While the Oracle Client full install includes an ODBC driver, the Oracle Instant
Client does not.)
Note: You cannot use an Oracle Direct Connection in a cross-connection query.
Authentication There are four types of authentication that you can use to connect to Snowflake in
Toad. The required Login fields will change according to the type of authentication
you select. All the authenticators are located in a dropdown list:
l Snowflake – User account authentication
l SSO – Single Sign-On via external browser
l OAuth – Token-based authentication
l MFA - Multi-Factor Authentication
l Key pair - JSON Web Token (JWT)
User Enter the username for your Snowflake account
Password Enter the password for your Snowflake account
Token Enter your authentication token (Only visible when connecting via OAuth)
Private key path Enter your Private key (Only visible when connecting via Key pair)
Passphrase Passphrase is required only if the keys are encrypted (Only visible when
connecting via Key pair)
4. Click Connect to save the connection and immediately connect to the database.
or
Click Save to save the connection without connecting to the database.
Authentication Notes
When using SSO or MFA, there is a way to maintain continuous and secure connectivity without needing to enter
login credentials for each connection attempt to Snowflake (as well as to prevent additional browser loading
whenever a new module is started in Toad Data Point). To achieve this, check whether the correct parameters have
been set in your account by executing the query below in your Snowflake cloud interface:
SHOW PARAMETERS IN ACCOUNT;
The output that will secure login credentials caching will have these values:
For SSO
allow_id_token = true;
For MFA
allow_client_mfa_caching = true;
If these values are set to false, then the following queries need to be executed:
For SSO:
ALTER ACCOUNT
SET allow_id_token = true;
For MFA:
ALTER ACCOUNT
SET allow_client_mfa_caching = true;
Note: If a Role or Warehouse isn’t chosen, the default settings from the Snowflake User account will be applied (it is
considered best practice that a user sets a default Role and a default Warehouse in their Snowflake user account).
Tip: It is strongly advised to use only the Snowflake user account authentication when creating Automation scripts
to avoid unnecessary workflow interruptions.
2. Select Microsoft SQL Server or Microsoft SQL Azure from the Group list box.
3. Review the following for additional information:
4. Click Connect to save the connection and immediately connect to the database.
or
Click Save to save the connection without connecting to the database.
Tip: Connections are stored in the connections.xml file and can be found by clicking the Application Data Directory
link in Help | About.
1. Click .
The next step is to enter a user name which has been configured for multi-factor authentication and put in the
appropriate App ID. After filling out the required information, click on Connect.
The step that follows will enable you to select a user from the list or add another one by clicking on Use
another account.
After that, you will be prompted to enter your credentials and depending on the type of authentication that the
account has been configured with, you will undergo an additional authentication step, such as the one in the
image below.
Note: This feature is available in the Toad Data Point Professional Edition only.
URL Enter the full URL address to the SharePoint OData service endpoint for the
SharePoint site to which you want to connect.
The URL address should have the following format:
http://<servername>/_vti_bin/listdata.svc
Authentication Select the type of authentication to use for this connection. Toad offers two options:
l Basic Authentication
l Active Directory Universal with MFA
4. Click Connect to connect immediately while saving the connection information. Optionally, click Save to
save the connection without connecting.
5. Upon creating an initial connection, Toad automatically maps the data source objects. This process
runs in the background, and until it is finished, you may experience a delay when attempting to access
these objects.
Tips:
l Connections are stored in the connections.xml file and can be found by clicking the Application Data
Directory link in Help | About.
l You can specify a proxy server to use for Business Intelligence and NoSQL connections at Tools | Options
| Database | Data Services.
After completing the final authentication step, a successful connection to SharePoint will be made.
Connection Issues
Review the following solutions to help troubleshoot SQL Server connection issues in Toad.
Issue Cause/Solution
Cannot specify a port number Currently, Toad does not have a separate field for specifying a port number.
when connecting Solution:
You can connect if you know the port number for the instance by entering the
following in the Server name field on the New Connection window:
ServerName,Port
or
IPAddress,Port
For example:
10.1.29.129,1234 (where 1234 is the port number of the instance)
Cannot connect to a remote Remote connections may not be enabled in SQL Server 2005. Also, named
instance in SQL Server 2005 instances are configured to use dynamic ports and select an available port
once the SQL Server Service starts. If you are connecting to a named instance
through a firewall, configure the Database Engine to listen on a specific port,
so that the appropriate port is opened in the firewall.
Note: Remote connections are disabled by default in the Express and
Developer editions of SQL Server 2005.
Solution:
To enable remote connections, see "How to configure SQL Server 2005 to
allow remote connections" at: http://support.microsoft.com/kb/914277
"Path is not of a legal form" error You attempted to migrate settings from a previous install of Toad to the current
message when connecting install, but the settings file (InitialSqlServer.Sql) for the previous install was
or either removed, moved, or corrupt.
Note: You must have a Simba Apache Spark ODBC Connector 2.8.2 (or later) installed before a native connection
is created.
Authentication Select the type of authentication to use for this connection. Toad offers two
options:
l Personal access token
l OAuth 2.0 token
Port The default port number is 443
HTTP Path Enter the endpoint used to route queries to the appropriate cluster or resource.
Token Enter your authentication token
Optional A connection can be made without providing this information
Catalog Enter the name of the Catalog you would like to connect to
4. Click Connect to save the connection and immediately connect to the database.
or
Click Save to save the connection without connecting to the database.
Tip: Connections are stored in the connections.xml file and can be found by clicking the Application Data Directory
link in Help | About.
Object Explorer
You can view database objects for the current connection with the Object Explorer. This feature is useful for
dragging and dropping database objects into an open Editor, Query Builder, or other document window. Right-click
the objects in the Object Explorer to access additional features such as multiple tasks and actions.
Schema (first field) Select the schema you want to view. You can filter the list of schemas that
display. See "Filter Databases and Objects" on page 28 for more information.
Object Filter (second You can quickly set a filter in this field. To do so, enter a name or partial name of
field) an object and press ENTER. Any advanced object filters you set display in this
field.
You can also perform advanced filtering based on case sensitivity, statistics, or
other options. See "Filter Databases and Objects" on page 28 for more
information.
Tip: You can enable an option to filter using regular expressions in Tools
| Options | Explorer | General.
Note: For tables and views, the columns, data types, and comments display at the bottom of this window.
l
To navigate to a previously selected object, click . You can also click to move to the next
selected object.
l To locate objects including procedures, functions, views, variable names and comments in an object's
source code, use Object Search. See "Search for Objects" on page 33 for more information.
l
To use a different method to select objects such as tabs, drop-downs, or a tree view, click .
l To generate reports, export data, create SQL statements, or send objects to the Project Manager, SQL
Modeler, or Master Detail windows, right-click the objects and select an option.
l To open the Background Processes window and cancel a query, click the progress bar at the bottom of
the window.
Types of Filters
You can create a Quick filter by entering a search string in the object filter field. You can also use the Filter dialog
(click ) to choose additional filter options. If you use the Filter dialog, you can also name and save your filter.
Quick (unnamed) Can be used to quickly filter objects for Applies to the current schema (or to
a single connection or schema. objects in the current schema) only.
Create a Quick filter by entering a Once applied, a Quick filter is in
search string in the object filter field. effect on that connection when you
reconnect or relaunch Toad.
Because Quick filters are not named,
they cannot be applied to other
connections by selecting from the
filter list. You must recreate the
Quick filter for each
connection/schema.
Detailed (unnamed) Use like a Quick filter, but add more -- same behavior as a Quick filter --
detail by using the Filter dialog to enter
filter criteria.
Use this method to create an unnamed
database filter.
Named Create and save named filters to reuse Once applied, a Named filter is in
and to apply to other connections of effect when you reconnect or
the same data source type. relaunch Toad.
Can be re-used on other
connections of the same data source
type (DBMS).
Note: If you rename a table that has a filter defined, it results in an orphaned filter. Orphaned filters are automatically
removed unless you used a tool other than Toad to remove them.
Create Filters
To create a Quick filter (objects only)
l Enter a search string to use for filtering in the object filter field (below the database field) in the
Object Explorer.
Note: As you enter a search string, the currently specified Search Condition displays in a blue banner below
the object filter field. This Search Condition will be used in your filter. To change the Search Condition, click
1. Click beside the database or object filter fields in the Object Explorer.
2. Specify criteria for the filter in the Properties tab. Review the following for additional information:
Search String Enter a text string and search characters to use for filtering.
Search Condition Select a search type to use in this filter.
Note: You can set a default value for this field in Tools | Options |
Explorer | General. If you don't specify a default value in Options, this field
defaults to the search type you specified the last time you created or
modified a filter (includes previous sessions).
3. To create custom SQL, select the SQL tab and then select the Enable custom SQL option. Modify the
existing SQL. (The existing SQL reflects the criteria you specified in the Properties tab).
4. Select the Preview tab to review the list of databases or objects that are selected based on your filter criteria.
2. Enter a name for the filter and click . Creating a name for the filter allows you to use it on other database
connections.
Use Filters
To use Named filters
l
To apply a Named filter, click the down-arrow beside and select the filter from the drop-down list.
l
To clear a Named filter, click the down-arrow beside and select <None>.
Icon Indicates
No filter is applied (all databases/objects display).
A filter is applied.
l
To export Named filters or all filters defined for the current connection, click the down-arrow beside in
the database field and select Export Filters.
l
To import filters previously exported from Toad, click the down-arrow beside in the database field and
select Import Filters. Browse to and select the filter file (.tfp) to import.
Tip: Click in the Database Explorer (Viewer) toolbar to clear all database, object, and data filters.
Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field
descriptions.
5. Place the cursor over the LAST_NAME column, click , and select Acton.
6. Click to the right of the LAST_NAME column again and select All to clear the filter.
7. Click the CONTACT_ID column to sort the rows in ascending or descending order.
10. Select a row of data in the grid. Notice that the row number changes in the bottom right of the status bar:
11. Under the SEX column, right-click the area below the last row in the grid that says "Right-click to add column
totals" and select Count. The total number of rows that have either a M or F value display.
12. Click to the right of the SEX column and select F. The count value updates based on the new filter.
13. Click to the right of the SEX column again and select All to clear the filter.
14. Select the SEX column header and drag it the area above the columns that says "Drag a column header
here to group by that column":
a. Right-click within a group or row on the grid and select Show | Card View.
b. Scroll through some records.
c. Click Customize in the Card View window.
d. Click Filter beside the ADDRESS_ID column and select 100. Notice how the card view is filtered, but
not the grid view.
e. Close the Card View window.
16. Edit a row:
a. Select a row in the FIRST_NAME column and edit the value.
b. Press ENTER to update the row.
c. Go to the BIRTH_DATE column and use the date picker to change the date.
Each data type have an appropriate editor.
Note: If you are using Oracle or a database that does not have auto commit on, you will need to
press Commit at the left hand bottom of the window.
17. Update the number of rows in in the data:
Tips:
l To remove objects from the search results, right-click the objects in the data grid and select Remove Items.
This is useful if you want to narrow the list of results to relevant objects.This does not remove the objects
from your database.
l To create a DDL script from the search results, right-click the data grid and select Create DDL Script. You
can then paste the results into the Editor.
l To perform any actions available for the object, such as creating, altering, dropping, exporting, and
generating reports or SQL, right-click the results in the data grid and select an option.
c. Provide the location of the Network Share and Object Annotation Cache settings to colleagues who
need to use this diagram.
2. Drag one or more tables from the Object Explorer, Object Search, or Project Manager window to the
Diagram pane at the top of the Master Detail Browser. Press CTRL+click to select multiple tables at once.
Notes:
l A line between tables indicates any existing relationships between the selected tables.
l At least one parent table (table without any join arrows pointing to it) must be added to the window or
an error message displays when returning results.
3. Join Columns.
4. Select the checkbox beside each column you want to include.
Note: Any columns included in a join are automatically included in the results.
5. Click (F9) to retrieve data for the parent table initially. To view data in a child table, click + to the left
of each row.
or
Click to retrieve data in the parent and child tables. If there is more than one child table, a tab displays
for each child table.
l
Click to align tables and snap them to the grid.
l Select the parent table from the drop-down list in the toolbar to view data for a parent table if there are
multiple parent tables.
l Click X on the table you want to remove in the Diagram pane to remove a table and any conditions (e.g., join,
where clause) associated with the table.
Scenario
Your company wants to improve its global sales, starting with countries where it has a
customer base but generally low sales. You need to create a query that identifies
countries with less than $500,000 in sales for each of the last four fiscal years.
Note: This scenario uses the SH (Sales History) sample schema that comes with Oracle
10g so you can follow the procedure.
Tips:
l Select Query Builder | Arrange Tables (ALT+Q+A) to have Toad arrange the tables in the
Diagram pane.
l You can press CTRL and select a table, and then drag the table into the Editor pane. Click the list to
create statements.
l You can also press CTRL and select all of the tables in the Object Explorer, and then drag them into
the Diagram pane. Toad automatically arranges the tables.
4. Add the following columns to the query by clicking each column:
Table Column
COUNTRIES COUNTRY_NAME
TIMES FISCAL_YEAR
SALES AMOUNT_SOLD
Tips:
l
To view details for a table in the Diagram, click (F4). If a table is not selected, details for the last
selected table display.
5. Complete the following steps to group the data and sum the sales:
a. Select the Group By field in the COUNTRY_NAME column, and then click +. The Group By field is
in the Criteria pane, which is below the Diagram pane.
b. Select the Group By field in the FISCAL_YEAR column, and then click +.
c. Select the Aggregate Function field in the AMOUNT_SOLD column and select Sum. This sums all
of the sales per fiscal year per country.
Note: If you select a group by clause or aggregate function for a column, the rest of the columns in
the query must also have a group by clause or aggregate function.
6. Complete the following steps to select the fiscal year range:
a. Select the Where Condition field in the FISCAL_YEAR column and click . The Where Condition
window displays.
a. Select the Having Condition field in the AMOUNT_SOLD column and click . The Having
Condition window displays.
b. On the Form tab, select < in the Operators field.
c. Select Sum in the Aggregate field.
d. Enter 500000 in the Constant field and click OK.
8. Select Ascending in the Sort field of the COUNTRY_NAME and FISCAL_YEAR columns.
9. Click .
The query results display in the Results tab. See "View Result Sets" on page 64 for more information.
10. To save the query, right-click the Query Builder tab and select Save File.
You can save a query and any results sets in a Toad editor file (.tef). This file format is useful for building
scripts that have large result sets that you do not want to continue executing or for saving results when you
have not finished building a script.
Note: This feature is available in the Toad Data Point Professional Edition only.
Note: Review the "Considerations and Limitations of Cross-Connection Queries" section below.
Tips:
l In a cross-connection code completion list, the selected database displays a descriptive tooltip containing
database and connection information.
l Use the Database Diagram tool to create and save cross-connection relationships, and then send the tables
with their relationships already created to the Query Builder.
Consideration/Limitation Description
Performance concerns A cross-connection query may take longer to execute than a query against a
single database because result sets from each database are retrieved and
combined to generate a single result set.
In the Professional edition of Toad Data Point, the enhanced execution engine
utilizes several optimizing techniques to improve the performance of cross-
connection queries.
ODBC driver support An ODBC driver can be selected for a single connection through each
connection's Properties dialog or globally through Tools | Options |
Database.
Using an Oracle connection in a To use an Oracle connection in a cross-connection query, you must install an
cross-connection query Oracle ODBC driver.
Note: The Oracle Full Install client includes an ODBC driver. However, if you
are using the Oracle Instant client (which may not include an ODBC driver),
you may need to install an Oracle ODBC driver.
Oracle Direct Connection You cannot use an Oracle Direct Connection in a cross-connection query.
Using a Teradata connection in To use a Teradata connection in a cross-connection query, you must install a
a cross-connection query Teradata ODBC driver.
Using a MySQL ODBC To use a MySQL ODBC connection in a cross-connection query, you must
connection in a cross- specify a database for the connection.
connection query
General Description
Single statement support The Query Builder only supports one statement at a time. If you add multiple
statements to the Query tab, only the first statement is used. If you make any
changes to the statement on the Diagram tab, the other statements are lost.
Quote identifiers If you selected the Quote Identifiers checkbox in Tools | Options
| Database | General and generate a query from the Query Builder in SQL
Server, the query cannot be reverse engineered.
ODBC support You must use ANSI SQL for the query.
Excel support Copying a generated query and attempting to reverse engineer that query
results in an error. This issue occurs because the parser defaults to Oracle
syntax, which does not understand quotation marks for fully qualified object
names. To avoid this issue, clear the Use fully qualified object names and
Use fully qualified column names checkboxes in Tools | Options
| Database | Query Builder or manually edit the query.
Non-ANSI joins (Oracle, SQL When sending a query from the Editor to the Query Builder, Toad
Server, and Teradata) automatically uses ANSI joins. If you use Where clause joins, click to
disable ANSI joins. This converts the statement to the correct join.
Where Condition Description
Where condition does not If you send a query that contains a Where condition from the editor to the
display in the Criteria grid Query Builder, it displays in a Global Where clause bubble on the Diagram
after sending it to the Query pane instead of in the Where Condition field in the Criteria grid.
Builder from the Editor You can double-click the Global Where Clause bubble in the Diagram pane or
Click in the Query Builder to send a statement to the Editor. Skip the remaining steps and continue to edit
the query. See "About Editing SQL" on page 59 for more information.
Troubleshooting: If the query cannot be modeled in the Diagram tab, a message displays and the
statement opens in the Query tab. This usually occurs because the graphical diagram cannot support some
functionality in the statement. You can view an explanation for this in the Output window or by hovering over
the syntax with a red underline ( ) in the Query tab. To continue, correct the error and click to apply the
change and open the Diagram tab.
2. Continue to build your query visually using the diagram.
3. Select the Query tab and make any additional edits. Indicators for an edited statement are as follows:
Inserted lines
Use the toolbar in the lower-right corner of the Query tab to modify the color used for each
indicator.
Caution: If you manually enter or update the statement in the Query tab, you must click to model
the query in the Diagram tab. If you do not do this and make additional changes in the Diagram tab, any
changes you made in the Query tab are lost.
Tip: If you have multiple statements in the Editor and you want to send only one to the Query Builder, highlight the
statement, then right-click it and select Send to Query Builder.
To build a subquery
1. Connect to the Toad Sample (Access) database in the Navigation Manager.
2. Select Tools | Query Builder | Query Builder.
3. Drag the ADDRESS table to the Diagram pane.
4. Click these column names in the ADDRESS table to add the columns to the query:
l ADDRESS_ID
l REGION_ID
5. To add a subquery:
a. Select the Where field in the REGION_ID column and click . The Where Condition
editor displays.
b. Select the IN operator from the list, and then click Subquery.
d. Drag the REGION table to the Diagram pane and select the REGION_ID column.
e. Select the Where field in the REGION_ID column and click . In the Where Condition editor, select
the In comparison operator, select Constant, and select the values 1 and 2.
g. Click to execute the subquery. Select the Results tab to review the result set for
the subquery.
6. Click the Query node in the Queries pane to return to the main query window. A call-out in the main query
Diagram pane indicates that the statement contains a subquery and identifies the column it is on. Hover over
the call-out to view the subquery statement.
If there are no variables in the SQL script, clicking on the Variables button will raise the following
message:
Automation Scripts. To learn about entering variable values for Automation scripts at run time, see the Set
Variable and Send Email activities in Use System Automation Activities.
Publish with Variables. To learn how to use variables when publishing to Intelligence Central, see Variables in
Views/Scripts and Publishing to Intelligence Central.
Toad supports the following bind variable formats:
l Colon (:variable)
Example: SELECT * from employee WHERE user = :user;
To set the default value(s) for the bind variable before the query is run
1. In the Editor, compose a query that contains bind variables.
Note: The Bind Variables dialog does not display if the bind variables option is disabled.
3. Enter the bind variable information. Review the following for additional information:
Name Displays the variable name in the form of a clickable link that brings up the Define
variable prompt values options for creating a list of predefined variable values.
Description Enter the description.
Type Select the data type for the variable from the drop-down list.
Default value Specify the default value(s) that will be used every time the query is run by:
n Entering the value(s) for the variable manually
n Or selecting the value(s) from the predefined list by clicking on the button
and choosing the particular value(s)
Note:
o If a variable has been defined with an IN\NOT IN operator, multiple values
can be entered by using the semicolon as a delimiter (each value needs to
be separated by a semicolon).
o The predefined list of values list needs to be configured in the Define
variable prompt values before using this option
The selected values from the list can be changed at any point in time (before and during query execution) in Toad
Data Point/Toad Workbook or Toad Intelligence Central (if the objects are published).
Note: Each value in the .txt or .csv file needs to be placed in a new line and no other delimiter
should be specified.
The query can be entered manually in the editor or it can be loaded from a Query Builder (.tsm)
or SQL file (.sql, .tef) by using the Open button.
If this option is deselected, only a single value can be chosen from the list and passed as a variable value.
l Restrict variable value(s) only to list – This option enables the user to restrict the variable values to the
predefined list which is created in the Define variable prompt values options. That means that the values
cannot be entered manually and can only be selected from the predefined list of values.
When the button is clicked, it will open the Predefine Values window which contains:
o A Search box (field) that enables the user to search or filter for specific value(s)
o The Refresh button which can be used to refresh the predefined list of values if they are obtained through
Get values from the column or Get values from the SQL script options.
To enable these options, the Prompt during run checkbox needs to be selected. After the checkbox is ticked, the
Define variable prompt values link appears along with a field for selecting the connection that will be used to run the
Clicking on the Define variable prompt values link opens a new window that contains options for
defining a list of variable values.
The options and functionality are identical to those that are found in Toad Query Builder, Editor and Workbook with
the exception of the Get values from the column option, which is not available in Toad Automation.
Include An option for including\excluding a specific bind variable at run time. The include
option is selected by default.
Name Displays the name of the bind variable that has been defined in the query.
Description Enter the description.
Type Select the data type for the variable from the drop-down list.
Direction Select the direction of variable from the list.
Value Specify the values for the run by:
n Entering the value(s) for the variable manually
n Or selecting the value(s) from the predefined list by clicking on the button
and choosing the particular value(s)
n Or loading the values from a specific .txt or .csv file by clicking on the ellipsis
(…) button and selecting the appropriate file.
Note:
o If a variable has been defined with an IN\NOT IN operator, multiple values
can be entered by using the semicolon as a delimiter (each value needs to
be separated by a semicolon).
o If you selected a direction of OUT or RETURN, this value is ignored.
o If default values have not previously been set in the Variables option, this
field will be populated with values that have been specified in the last run.
o If default values have previously been configured, any changes made will
apply only for the current run.
o If the values for the run are loaded from a .txt or .csv file, each value in the
.txt or .csv file needs to be placed in a new line and no other delimiter should
be specified.
2. Enter a name and a value for the bind variable, and specify a data type.
Tip: After you store a bind variable, it is available to be used as a variable in Automation. The stored bind variables
appear in the list of variables in the expression editors in various activities.
Note: Defining and using a custom list of values for bind variables is not supported for global variables.
For example:
Create table {{Quote(:name)}} as select * from dual
3. Execute the statement. The Bind Variable dialog opens.
4. Enter a string to use in place of :name and click OK.
5. Toad inserts the string (quoted if necessary) into the SQL statement and executes it.
Tip: See About Toad Script for more built-in functions that can be used in scripts that you execute in Toad.
Related Topics
About Editing SQL
To edit SQL
1. Select Tools | Edit | SQL Editor.
Note: You can query the worksheet from the Editor by entering a dollar sign ($) followed by a cell range to
limit the results similar to the following statement:
Select * from (MyWorksheet$A1:C10)
You can also query the entire worksheet by entering a dollar sign ($) after the worksheet name; however,
this returns empty rows and columns in the worksheet.
2. Review the following to help enter SQL:
l Code completion
l Script Map
l Code regions
l Code snippets
l Toad views
l SQL recall
l Add/remove application code
l View Objects at Cursor
l Macros to record keystrokes
4. Right-click a block of code in the Editor to see additional actions available in the context menu. For example,
you can turn a line into comment, uppercase or lowercase it, surround with snippet, set numbered
bookmark, collapse or expand nodes, send to Query Builder and etc. You can also right-click an object (e.g.
a table) and manage it as if in the Object Explorer.
5. Hold Alt + left-click and drag to select vertical blocks of text in Editor.
6. Select the block of code in the Editor, and click to validate the syntax.
Note: Toad undoes any changes to the object and data in the database after executing the script (notice that
the Result Sets tab is empty). To modify the object and data, you need to execute the script.
7. Click Fetch n rows to specify the number of rows to initially retrieve when executing the query. You can set
a default value for this option in Tools | Options | Database | General. See General Database Options .
8. Click to execute SQL on the current server or multiple servers at one time. In the Editor toolbar, the
execute SQL buttons are grouped under . The button will retain the function of the last execute action
for the active Editor window. If you switch to another Editor window, the button will change to reflect the last
action for that window.
9. Select the block of code in the Editor and click to create a stored procedure. Stored Procedure creation
dialog automatically recognizes procedure body and declared parameters.
Tips:
Caution! If you have some global access keys assigned, make sure that Toad shortcut keys do not coincide
with them. When using such duplicating shortcut keys in Toad, the third party application commands, assigned
globally, will be performed instead of ones assigned by Toad.
Clipboard Description
CTRL+C Copies the selected text to the clipboard
CTRL+X Cuts the selected text for pasting in the clipboard
CTRL+V Pastes text from the clipboard
Code Completion Description
CTRL+PERIOD Displays code completion list
ENTER Selects an item and close the code completion list
CTRL+SPACE Selects an item without closing the code completion list
CTRL+<right arrow> Expands a node in the code completion list
CTRL+<left arrow> Collapses a node in the code completion list
Comment Description
CTRL+MINUS Comments the selected line
CTRL+SHIFT+MINUS Uncomments the selected line
Cursor Description
HOME Moves the cursor to the beginning of the line
CTRL+HOME Moves the cursor to the beginning of the file
END Moves the cursor to the end of the line
CTRL+END Moves the cursor to the end of the file
Debugger Description
SHIFT+F12 Step from cursor
F7 Step into
SHIFT+F7 Step out
F8 Step over
Troubleshoot Data
l
If you cannot edit data, click the red icon in the lower left corner of the grid, and then click OK on the
window that displays. You do not need to edit fields in this window.
l By default, auto commit is enabled and any row changes you make are automatically submitted to the
database. You can disable this option in Tools | Options | Environment | Grid.
You can also save a result set and later use it as a historical comparison.
2. Review the differences.
Tips:
l To switch the contents of the left pane to the right pane, and the contents of the right pane to the
left, click .
l You can also open files to compare by clicking beside the drop-down list at the top of each pane.
l You can show or hide tables that contain equal records, different records, etc., at any time using
the toolbar.
Tip: To refresh data in a linked query report, click in Excel's External Data toolbar. This executes the
underlying query for the report. See "Share Excel Linked Queries" on page 68 for more information about
creating and using linked queries.
Note: If the window containing data does not have the focus when you select a One Click Export option, the
following message displays: "Export did not find any results sets to process."
Tips:
l To specify a default export folder, go to Tools | Options | Environment | Export.
l To always open a Save File dialog when exporting using One Click Export, go to Tools | Options
| Environment | Export and select the option. This allows you to always customize the file name.
Scenario
You need to create an Excel linked query so that the Regional Sales Manager, can track
whether the Sales Representatives in his region meet their monthly and quarterly goals.
By providing a linked query, you only have to create the query once, and then the
Regional Sales Manager can refresh the data at any time to view the latest sales
information.
Before Publishing
If you are publishing data using a native provider or ODBC connection, the corresponding ODBC driver must
exist on the TIC server. In addition, for native database connections other necessary client files must exist on the
TIC server. To learn how to prepare the TIC server for publishing, see Prepare to Publish Data to Toad
Intelligence Central.
Related Topics
Publish to Toad Intelligence Central
Note:This feature is available in the Toad Data Point Professional edition only and requires access to a Toad
Intelligence Central server.
Important: To undo changes, click Reset. Then click to return to the Summary page.
Toad documents: The name must be unique within a folder per Toad document type. For example, no two ER
Diagrams in the same folder can have the same name, but an ER Diagram and a Query Builder file in the same
folder can have the same name.
Automation scripts: A script name must be unique among scripts. No two scripts can have the same name within
an Intelligence Central instance.
Related Topics
Prepare to Publish Data to Toad Intelligence Central
User Authentication in Intelligence Central
Explore Toad Intelligence Central
Publish Other Toad Resources
1. In the Publish to Intelligence Central dialog, click next to the Destination Folder field.
Viewing Databases
Third Party Application
When using a MySQL connection to Intelligence Central, the following databases which contain published objects
are visible:
l User-defined databases—A database is created for each new destination database created through the
Publish to Intelligence Central dialog.
l folder name database—Each time a new folder (or sub-folder) is created through the Publishing dialog
without specifying an existing database, a default database is created using the folder name. This database
contains each object originally assigned to that folder. Even if an object is moved to another folder through
the Object Explorer, the object remains in the original database. For a sub-folder, the database name is
<parent folder>_<sub-folder>.
l published_objects database—The "published_objects" database contains the objects in the "No folder
assigned" folder.
l Legacy databases—If the Intelligence Central instance contains objects that were published using Toad
Data Point 3.6 or earlier, a database was created for each data source (containing all objects published from
that data source). See Explore Toad Intelligence Central for more information about datasource names. In
addition, a database was created for each user and contains their published datasets (data_username).
Toad Data Point
In the Object Explorer, the Intelligence Central databases listed above are visible, as well as the following:
l database/folder name database—If you select an existing folder but do not use the default database and
instead select a different database in the Publishing dialog when publishing an object, Toad creates a folder
under the Databases node in the Object Explorer using the format database/folder.
2. In the Object Explorer, select a script and click to run it. Toad prompts you for a variable value. Enter the
value. This value is used for this execution only. The default value remains unchanged.
Tip: The Web Console in Toad Intelligence Central 3.3 (or later) allows the user to enter a variable value at run time.
In Toad Intelligence Central 4.3 (or later) the user can also modify a variable default value. See the Toad
Intelligence Central Quick Start Guide for more information.
Related Topics
Manage Automation Scripts in Intelligence Central
Views in Intelligence Central
Consideration/Limitation Description
Toad replaces native provider If you publish data using a native database provider connection, Toad
connection with ODBC converts that native connection to an ODBC connection on TIC. In order to
Related Topics
Publish to Toad Intelligence Central
Troubleshoot Publishing to Toad Intelligence Central
Related Topics
Publish to Toad Intelligence Central
Datasets
About Data Sources
Related Topics
Troubleshooting Automation Script Publishing
Publish to Toad Intelligence Central
Report
Tutorial: Create a Toad Data Report
Use the Data Report Designer to design reports visually. Stored in .tdr files, data reports are "live" reports that can
be refreshed dynamically. What makes them dynamic is that they contain the underlying queries for report data
sets. Each time a data report is opened, its query runs and the latest data is retrieved. The dynamic nature of data
reports makes them ideal for distribution to users who need to see changes to data without waiting for scheduled
updates or for new reports to be distributed.
Note: This procedure does not cover all of the possible steps of creating a data report. It only covers the steps
required to create a report for the scenario. See About Designing Toad Data Reports for more information.
Scenario
Your company wants to improve its global sales, starting with countries where it has a customer base but aver-
ages low sales. You created a query that displays countries with less than $500,000 in sales per fiscal year,
but now you need to create a report to help represent and evaluate the results. The data should be grouped
per country and show the total and average sales for each country. In addition, you want the report to look
similar to the rest of the company's documents, which use specific colors and fonts.
Note: This scenario uses the data generated in Visually Build a Query.
4. Select COUNTRY_NAME and click , and then click Next. This groups the data by the country name so that
each country is listed as a heading and its sales per year display below it.
Tip: You can create a secondary group by selecting another column and clicking again. A secondary
group is not appropriate for this scenario, but it would be if the data included regions in each country or
fiscal quarters. You would need to make the region or fiscal quarter a secondary group for the data to be
organized appropriately.
5. Select the Sum and Avg checkboxes for the SUM(SALES.AMOUNT) row, and then click Next. These
options calculate the sum and average sales amount for each country.
Tip: The Outline and Align Left options are good choices if you grouped the data.
9. Click Preview to see what the report looks like in print. Previewing the report makes it easier to see how
the bands and their content display in the printable report.
3. Select the following fields one at a time and make them wide enough to see the full text: Sum (groupFoot-
erBand1), Average (groupFooterBand1), and Grand Total (reportFooterBand1).
4. Select the following fields one at a time and drag them to the one inch mark on the ruler: Sum, Average,
and Grand Total.
5. Right-click the COUNTRY NAME field (not the COUNTRY_NAME field on the right) in groupHeaderBand1 and
select Delete.
Note: The COUNTRY NAME field is a label that precedes the COUNTRY_NAME field value. If you preview
the report before you delete the COUNTRY NAME field, the country displays as 'COUNTRY NAME Argentina'.
It is clear that Argentina is the country name, so this field is redundant.
6. Select the COUNTRY_NAME field and drag it to align with the report title.
7. Select the COUNTRY_NAME field and make it three inches wide to accommodate long country names.
c. Select Title.
d. Select the Foreground Color field, and then select MidnightBlue in the Web tab.
e. Select the Font field and click . The Font window displays.
2. Complete the following steps in the Styles Editor window to create and define four new styles:
a. Click four times in the Styles Editor window to create four new styles.
Name OddRow
Borders Bottom
Name EvenRow
Borders Bottom
Name TableHeading
Name CountryName
b. Select TableHeading in the Style field (under Styles) for the Fiscal Year and Sales Amount
fields in groupHeaderBand2.
d. Select the COUNTRY_NAME field in groupHeaderBand1 and then select CountryName in the Style
field.
2. Complete the following steps to add a line under the report title:
Tip: It is helpful to expand a band before adding controls to give you plenty of room in which to
work.
3. Select reportFooterBand1 and drag it down half an inch. This adds white space between the country inform-
ation.
4. Click Preview.
5. To save the report, right-click the Data Report Designer tab and select Save File.
Manage Reports
About Managing Reports
Use the Report Manager to create and organize data reports, add existing Toad or Excel reports, or generate
reports.
To create a report
1. Select Tools | Reports | Report Manager from the menu.
b. Right-click the folder where you want to add the report, and select Add Existing Report.
Tips:
l To add an existing Toad or Excel report to the Report Manager, right-click the Report Manager window and
select Add Existing Report.
l To send a Toad or Excel report via email or to a shared folder or other location, right-click the report, select
Send To, and then select an option.
l To share reports with other users, specify a shared network directory in Network Share Options (Tools |
Options | Environment | Network Share).
DB2 Reports
The following reports are available from the Reports Manager (Tools | Reports | Reports Manager).
Activity Lists and describes activity reports that the Activity Monitor for the current DB2 for LUW
database uses. This report also lists the switches required to gather data for a specific
activity report. Toad uses the AM_BASE_RPTS table function to generate this report.
ADMIN_LIST_HIST_ Displays information from the database history table for the DB2 for LUW database par-
V82 tition to which Toad is currently connected. Toad uses the ADMIN_LIST_HIST table func-
tion to generate this report.
Database Partitions Shows information about each database partition on the current DB2 for LUW database.
Toad uses the DB_PARTITIONS function to gather this information from db2nodes.cfg.
DB Manager Config Lists the database manager configuration parameters and their values defined for the
Info current DB2 for LUW database.
HEALTH_CONT_HI Shows the current "health" status of all containers that tablespaces in the current DB2
for LUW database use. Toad uses the HEALTH_CONT_HI table function to generate this
report.
HEALTH_CONT_HI_ Shows a "health" history for all containers that the tablespaces in the current DB2 for
HIS LUW database use. Toad uses the HEALTH_CONT_HI_HIS table function to generate this
report.
HEALTH_CONT_ Identifies the containers that tablespaces in the current DB2 for LUW database use and
INFO lists the highest current alert status for each container. Toad uses the HEALTH_CONT_
INFO table function to generate this report.
HEALTH_DB_HI Shows the "health" status of the current DB2 for LUW database, including its highest cur-
rent alert status. Toad uses the HEALTH_DB_HI table function to generate this report.
HEALTH_DB_HI_HIS Shows the "health" history of the current DB2 for LUW database. Toad uses the
HEALTH_DB_HI_HIS table function to generate this report.
HEALTH_DB_HIC Shows the "health" status of objects in the current DB2 for LUW database. Toad uses the
HEALTH_DB_HIC table function to generate this report.s
HEALTH_DB_HIC_ Displays a "health" history for objects in the current DB2 for LUW database. Toad uses
HIS the HEALTH_DB_HIC_HIS table function to generate this report.
HEALTH_DB_INFO Shows the highest current alert status for the current DB2 for LUW database. Toad uses
the HEALTH_DB_INFO table function to generate this report.
HEALTH_DBM_HI Shows the "health" status for the current DB2 for LUW instance. Toad uses the HEALTH_
HEALTH_DBM_HI_ Shows a "health" history at the database manager level for the current DB2 for LUW
HIS instance. Toad uses the HEALTH_DBM_HI_HIS table function to generate this report.
HEALTH_DBM_INFO Shows the highest current alert status for the current DB2 for LUW instance. Toad uses
the HEALTH_DBM_INFO table function to generate this report.
HEALTH_TBS_HI Shows the "health" status of all tablespaces in the current DB2 for LUW database. Toad
uses the HEALTH_TBS_HI table function to generate this report.
HEALTH_TBS_HI_ Shows a "health" history for tablespace in the current DB2 for LUW database. Toad uses
HIS the HEALTH_TBS_HI_HIS table function to generate this report.
HEALTH_TBS_INFO Shows the highest current alert status for each tablespace in the current DB2 for LUW
database. Toad uses the HEALTH_TBS_INFO table function to generate this report.
Index Statistics Displays statistics for the indexes under the current schema for the DB2 for LUW data-
base and flags those indexes that need reorganization. Toad uses the REORGCHK_IX_
STATS procedure to generate this report.
Installed DB2 Lists the DB2 for LUW 9 products currently installed on your system. Toad uses the ENV_
Products GET_PROD_INFO table function to generate this report. Products can include the fol-
lowing: RTCL DB2 Run-Time Client CONSV DB2 Connect Server (any edition) CONPE
DB2 Connect Personal Edition
Installed DB2 Lists the DB2 for LUW 8 products currently installed on your system. Toad uses the ENV_
Products_V82 GET_PROD_INFO table function to generate this report. Products can include the fol-
lowing:
l ADCL DB2—Application Development Client
l PE DB2—Personal Edition
l QP DB2—Query patroller
l WM DB2—Warehouse Manager
Instance Inform- Lists details about the current DB2 for LUW instance. Toad uses the ENV_GET_INST_
ation_V82 INFO table function to generate this report.
Recommendations Provides recommendations (in English) for the various activity reports that the activity
for Activity Reports monitor uses. Toad uses the AM_BASE_RPT_RECOMS table function to generate this
report.
SNAP_GET_ Displays information and statistics about each container that tablespaces in the current
CONTAINER _V82 DB2 for LUW 8 database use. To generate this report, Toad uses the SNAP_GET_
CONTAINER table function to retrieve information from the tablespace_container logical
data group.
SNAP_GET_DB_V82 Lists information and statistics captured for the current DB2 for LUW 8 database. To gen-
erate this report, Toad uses the SNAP_GET_DB table function to retrieve information
from the database and detail_log logical data groups.
SNAP_GET_DYN_ Lists statistics and information about the dynamic SQL statements executed against the
SQL_V82 current DB2 for LUW 8 database use. To generate this report, Toad uses the SNAP_GET_
DYN_SQL table function to retrieve information from the dynsql logical data group.
SNAP_GET_TAB_ Lists information and statistics about the tables in the current DB2 for LUW database 8.
V82 To generate the report, Toad uses the SNAP_GET_TAB table function to retrieve inform-
ation from the table logical data group.
SNAP_GET_TBSP_ Lists information and statistics for the database partitions that make up each tablespace
PART_V82 in the current DB2 for LUW 8 database. To generate this report, use the SNAP_GET_
TBSP_PART table function to retrieve information from the tablespace_nodeinfo logical
data group.
SNAP_GET_TBSP_ Lists information and statistics for each tablespace in the current DB2 for LUW 8 data-
V82 base. To generate the report, Toad uses the SNAP_GET_TBSP table function to retrieve
information from the tablespace logical data group.
SNAPSHOT_AGENT_ Lists the agents working for the various applications connected to the current DB2 for
V82 LUW 8 database. To generate the report, Toad uses the SNAPSHOT_AGENT function to
retrieve information from the application snapshot, especially from the agent logical
group.
System Inform- Displays information about the operating system in which the current DB2 for LUW 8
ation_V82 database operates and about the CPUs configured on this operating system. Toad uses
the ENV_GET_SYS_INFO table function to generate this report.
Table Statistics Displays statistics for the tables under the current schema in the DB2 for LUW database
Column View and flags those tables that need reorganization. Toad uses the REORGCHK_TB_STATS
procedure to generate this report.
Table Statistics Displays statistics for the tables under the current schema in the DB2 for LUW database
and flags those tables that need reorganization. Toad uses the REORGCHK_TB_STATS
procedure to generate this report.
MySQL Reports
The following reports are available from the Reports Manager (Tools | Reports | Reports Manager).
ODBC Reports
The following reports are available for the Toad Sample Database in the Reports Manager (Tools | Reports
| Reports Manager):
Customer orders Displays customer orders for contact IDs less than 10 from the Toad sample database. It
is an example of master detail display using a single result set.
Customer list Displays a list of customers from the Toad sample database.
Items to order Displays items in stock that have a quantity of less than 50 and should be reordered from
the Toad sample database.
Oracle Reports
The following reports are available from the Reports Manager (Tools | Reports | Reports Manager).
Cluster Reports
Clusters Displays cluster information, including the cluster type, definitions, storage parameters,
and affected tables.
Other Reports
Invalid objects Displays any invalid objects for the selected schema and includes a subtotal of all invalid
objects for that owner.
Loads into shared Displays packages that have been loaded five or more times, into the Oracle shared pool.
pool Note: You must have DBA privileges for this report.
Non-system objects Displays any objects in the SYSTEM tablespace that are not owned by SYSTEM.
in SYSTEM tables
Oracle initialization Displays the values for all parameters defined in the PFILE for the selected user.
parameters
Tablespaces near Displays tablespaces that over 90% full, and do not have the autoextend feature
capacity enabled.
Total shared pool Displays the number of times objects in the shared pool were reloaded.
reload stats Note: You must have DBA privileges for this report.
User hit ratios Displays the buffer cache hit ratio users and includes consistent gets, blocked gets, and
physical reads.
User resource usage Displays values for resource usage such as CPU used and SQL*Net roundtrips for each
user.
Sequence reports
Sequences Displays the sequences that are within 10% of the maximum value. Any sequences that
do not have a maximum value set, or those that cycle are excluded from the report.
Sequences near Displays the sequences that are within 10% of the maximum value. Any sequences that
max do not have a maximum value set, or those that cycle are excluded from the report.
Arguments of Displays any parameters required for the selected stored procedure.
stand-alone stored
programs
Object type bodies Displays the body or source code for a selected object.
Object types Displays the type of objects owned by a user, including whether the objects are valid and
when they were created or last modified.
Package bodies Displays the body or source code for a selected package
Package spe- Displays specifications for a selected package, including whether it is valid and when it
cifications was created or last modified.
Stand-alone stored Displays the source code for a stored program, including the type of program and the last
programs time DDL was generated.
Stored object with Displays a list of all stored programs including their source.
source
Stored procedures Displays the source for stored procedures for a selected owner.
Synonyms Displays information for each synonym, including the owner, table owner and name, and
the DB link.
Table Reports
Indexes Displays details for the index definition, storage parameters, and columns included in the
index.
Non-indexed tables Displays any tables that have not been indexed for the selected database.
Tables & columns Displays all columns for a selected table, including the maximum transactions, used/free
blocks, free lists and groups, min/max extents, and columns included in this index.
Tables & indexes Displays any indexes for a selected table, including the status, uniqueness, and columns
included in the index.
Trigger Reports
Triggers & columns Displays triggers for a selected table, including the trigger event, status, WHEN clause,
and columns associated with the trigger.
User-defined Reports
Sample Displays a sample user report based on a select * from dual query.
View Reports
Views & columns Displays all columns for a selected view, including the query and columns included in the
view.
DBA Reports
All jobs Displays all scheduled SQL Server jobs and the job owner, organized by server.
Backup history Displays the backup start date, type, and device used for the backup for a specified data-
base for a set number of days.
Backup status Displays the database name, date of the last backup, days since the last backup, and the
type of backup performed.
Current lock report Displays any locks on the server, including the database name, object or index name,
type of lock, resource, mode, and status.
Database con- Displays configuration options for each database on the specified server.
figuration options
Database settings Displays any common options and their values for all the databases on your server.
Database user Displays the user name, roles, objects, granted/denied status, and column permissions
details for each database.
Display errors Displays a log file without entries for log backups. This is useful when you have a number
of log backup entries and you need to locate non-backup errors.
Drive space usage Displays space for all databases on the server, including free space, space used, max-
imum size, and growth type.
Foreign key Displays tables in the order you can either populate or delete from them without violating
sequence any foreign key constraints. Objects with the lowest wave number indicate that they can
be deleted with the fewest number of foreign key references. Objects with the highest
wave number should be populated first.
Index description (SQL Server 2000 only) Displays all indexes for the current database sorted by table.
Index information includes whether it is clustered, unique, index keys, and the index
size. run frequency, and the maximum duration.
Job details (SQL Server 2000 only) Displays all SQL Server jobs, including whether they are sched-
uled, enabled, start date and time,
Row count for tables Displays the number of rows for all tables on a server that contain a clustered index.
with clustered index
Total rows and Displays the total number of rows and space used for each table or view in the current
space used database, including the reserved rows, unused rows, and index size. This report is sorted
in descending order by reserved rows.
User permissions Displays users permissions, grouped by role name and object type.
Configuration change his- Displays a history of all sp_configure and Trace Flag Changes recorded by the
tory default trace.
Schema change history Displays a history of all committed DDL statement executions recorded by the
default trace.
Table Reports
Indexes Displays index information for a selected table, including whether the index is
clustered, unique, ignores duplicate keys, allows page/row locks, and a list of
indexed columns.
Non-indexed tables Displays any tables that have not been indexed for the selected database.
Table constraints Displays any check constraints for a selected table, including whether the con-
straint is enabled, valid data, and affected columns.
Table extended prop- Displays any extended properties for a selected table.
erties
Table relationships Displays any foreign key constraints for a selected table, including whether the con-
straint is enabled, referenced tables, and referenced keys.
Tables and columns Displays all columns for a selected table, including the data type, default value,
whether it allows null values, and for SQL Server 2005 any extended properties.
Tables and indexes Displays any indexes for a selected table, including the name, columns included in
the index, and whether it is unique or clustered.
Stored procedures Displays stored procedures for a selected database, including their status, status,
replication information, schema version, statistics, and procedure text.
l Email reports and files, including Database Diagrams, Query Builder queries, SQL scripts, and results for
reports, queries, and scripts.
l Share reports and files in a central location such as the Toad shared folder.
You can use the following methods to publish and share information:
Automation Drag the Send Email activity to the Automation workflow and attach files as
needed. The email is sent when the automation script executes.
Project Manager, Right-click a report or file and select Send To | Toad Shared. The file is
Reports Manager sent to the Toad shared folder specified in Tools | Options | Environment
| Network Share.
Automation Drag the Copy File activity to the Automation workflow. Specify the file to
copy or move and a destination folder. This can be any folder, including the
Toad shared folder, or a network folder. The file is copied or moved when the
automation script executes.
Automation Drag the Zip File activity to the workflow. Add reports and files to the Zip file
and specify a file name with a .zip extension. The ZIP file can then be emailed
with the Send Email activity or copied with the Copy File activity.
Automation Drag the Publish Files activity to the Automation workflow. Add reports and
files created previously in the script or add other existing files.
Tips:
l To export a Toad report to a file that can be read by other applications, double-click a report in the Reports
Manager, click in the Report Preview window, select a file format, and add the file to a project. Share
or publish the file using the Project Manager functions.
l To capture report results in a file, add the Toad Report automation activity. This activity runs a Toad report
and saves the results in a file format you select. Share or publish the file using the Automation functions.
l To execute and save a query in a file, add the Select To File automation activity. This activity runs a query
or SQL script and exports the results to an Excel spreadsheet. Share or publish the spreadsheet using the
Automation functions.
This tutorial helps you get started with Automation by giving you an overview of the Automation module and then
guiding you through the process of creating a basic script.
In this tutorial you will learn:
l How to use the Automation window
l How to create a basic script using the Select to File activity
l How to test and run a script
l How to schedule a script
l How to create a template for reusing an Automation activity
Note: The Automation module is disabled if Toad was installed with the Prohibit saving passwords
option selected.
Introduction
Toad provides an Automation utility that allows you to easily script database activities and schedule them using the
windows scheduler. In this way, database tasks can be automated to save you time. Toad Automation can increase
your productivity by allowing you to automate tasks that you perform repeatedly.
The Benefits of Using Automation
l Automating repeatable tasks allows you to be more productive and increases your efficiency.
l Toad Automation scripts are very flexible and extensible, allowing you to customized them to your needs.
l You can create and use variables in Automation scripts. Variables allow you to make your scripts flexible
and to customize your scripts to different audience and company needs.
l You can incorporate a variety of templates into Automation scripts. Using templates in your scripts can help
you get the most out of automating your tasks. Templates include: Microsoft Excel® files, Export Wizard
templates, or Toad Report templates. You can even create an Automation activity template allowing you to
reuse an activity.
l There is no limit to the number of tasks you can include in an automation script.
l Toad Automation scripts are conveniently scheduled and run by the Windows scheduler. You can track and
manage your scheduled scripts using Toad or the Windows Scheduler interface.
Toad sends your SQL to the Automation Tutorial (Guided Tour) which opens in a separate
window.
3. Select a task and complete the wizard.
4. After you click Finish in the wizard, an Automation window opens containing your new script.
The script incorporates your SQL statement and the settings you specified in the wizard.
Note: You must drag the activity to an Add Activity icon in the Automation workflow. When you see the
activity's icon displayed in the workflow, release the mouse button.
Details Pane—Displays an activity’s settings. Click an activity in the design pane to display its configurable
settings in the details pane. Use the details pane to specify the settings for each activity in the script.
2. In the Toolbox, find the Database Activities group. Single-click the Select to File activity to add it to the
script design pane.
3. With the Select to File activity still selected in the script design pane, view the details pane. The details pane
allows you to configure settings for the selected activity. The input fields change depending on which activity
is currently selected in the design pane.
Note: The Activity Input tab is the tab where you will specify most of an activity's settings.
4. Click next to the Select to File activity. Toad uses this icon to indicate that more information is required to
complete the activity. Click or hover over the icon to display the missing information. Use this icon to help
you determine which input fields are required.
Note: This icon is also used to indicate a validation error, for example, when referencing a variable that has
not been created yet.
5. Now click the Settings icon in the design pane. The details pane changes to display input fields for the
script’s settings. You can use this area to specify script error handling, logging level, and run environment
6. Click the Stop on Error button, if not already selected. This instructs the script to stop if an error is
encountered.
Note: You can also enable or disable the Stop on Error option for each individual activity. If you know that a
particular activity will have an error, you can disable the Stop on Error option for just that activity. This
option is located on the Activity Info tab for each activity.
7. In addition to selecting the Stop on Error option, enabling the Send email when error occurs and Attach
log file to email options is also preferred. This can be very useful if your script encounters an error.
Enabling your script to send an email notification on error, as well as on success, helps you to feel confident
that your processes are running as expected.
If you choose to enable these options, you must specify email settings. To specify email settings, click the
Compose Email button.
8. Keep this Automation script window open, and proceed to the next section.
Note: If you schedule a script to run against a password-protected database for which you did not save the
password in Toad, the script will error. To save the password, right-click the connection in the
Connection/Navigation Manager and select Properties. Enter the password and select the Save
Password option.
Tip: For Snowflake connections, it is considered best practice to use only the Snowflake user account
authentication when creating Automation scripts to avoid unnecessary workflow interruptions.
3. Now select an input. Most activities require an input, and in the Select to File activity the input is a SQL
statement. You can input a SQL statement using one of the following methods:
l Manually enter a SQL statement in the editor box (deselect the Link SQL file option).
l Click to browse to and select a SQL file.
l Select Link SQL file, then click to browse to and select a SQL file. This option retains a link to
the SQL file.
l
Click to open the SQL file (you previously selected) in the Editor where you can modify the SQL.
l Select Link SQL file, then click the drop-down list to select a file from the currently open project in
the Project Manager.
5. Click in the Name field and select a location and enter a name for your new Excel file.
6. You can also add a suffix to the file name. In the suffix field, click the drop-down to select a datetime stamp,
or click to build an expression. You can use this method to add a variable or a custom datetime stamp.
Appending a datetime stamp to the file name allows you to create a unique file with each script execution.
7. You now have a complete activity, with input, output, and database connection specifications. You can save
and reuse this activity in other scripts by saving the activity as a template. To do this, right-click the activity
(after configuring all the settings) and select Save As Template. Enter a name for your template and click
OK to save it.
Your template now appears in the Toolbox in the Templates category.
8. Keep the Automation script window open and proceed to the next section.
3. Toad then validates your entries and compiles the script. If these processes are successful, the script runs.
4. While the script is running, Toad displays your script’s execution progress in the Log tab. The message
“Done” indicates script execution is finished.
5. When a script produces an output file, a hyperlink to the output file is included in the Log. If your script ran
successfully, click the output file hyperlink to view the new Excel file created by your script.
6. Click the Settings icon to return to the script’s settings.
3. To schedule the script, select the Triggers tab. Then select the scheduling trigger and click Edit. In the Edit
Trigger dialog, ensure that the On a schedule trigger type is selected. Then specify a frequency, start time,
interval, etc.
4. Click OK to save your schedule. Click OK to save and close the task properties dialog.
5. Your task (script) is now listed in the Task List in the Job Manager. Double-click your task in the list to open
the task properties dialog again where you can make modifications, such as re-scheduling or changing the
script location. Use the Task List to review the status of your tasks (scheduled scripts).
6. By default, the scheduled task runs under your Windows account. If you change your Windows password,
you may also need to update the password in your scheduled task (depending on your version of Windows).
Click and select the task to update. Click OK and then enter your password when prompted.
7. After upgrading to a new version of Toad, you must migrate the scheduling tasks to the newer version. See
"Upgrade Automation Scripts and Scheduling Tasks" in the online help for more information.
Introduction
After creating a result set in Toad, you may need to send the results to your end users. The easiest way to
create a report containing query results is to export the data to an Excel file by right-clicking the data grid and
selecting Quick Export | File | Excel File. This action creates a basic Excel spreadsheet containing the result
set from the data grid.
If you want to create more than a basic spreadsheet and automate the process, Toad Automation helps you build a
variety of Excel reports, from simple worksheets to complex and attractive Excel reports.
In this introduction to automating Excel reports, you will learn how to automate the process of exporting data to a
variety of simple Excel reports.
Note: To learn how to get started with Automation, see Getting Started with Automation.
l Select Link SQL file, then click to browse to and select a SQL file.
l
Click to open the SQL file (you previously selected) in an editor where you can modify the SQL.
l Select Link SQL file, then click the drop-down list to select a file from the currently open project in
the Project Manager.
6. Click in the Name field to select a location and enter a name for your new Excel file, or you can select an
existing file.
Note: To specify more-detailed options for the Excel file, click the Export options button.
7. (Optional) You can choose to create a unique file by adding a suffix. In the suffix field, click the drop-down to
6. In the Name field, click to select a location and enter a name for your file.
7. Leave the suffix field blank (adding a date/time suffix could create a new file with each script execution and
this is not the objective of this example).
8. Deselect Overwrite (you do not want to overwrite the file).
9. Now click Export options. The Export options dialog opens.
10. In the Worksheet name field, enter a name to be used as the base worksheet name.
11. Select Append timestamp to named worksheet. This will append the date and time (that the data was
exported) to the base worksheet name. Click OK to save your settings and close the dialog.
6. Click in the Name field to select a location and enter a name for your new Excel file.
7. Click Export options and make sure the Worksheet name field is blank.
Note: If the Worksheet name field is not blank, your script will export both result sets into the named sheet,
and the second result set will overwrite the first.
8. Selecting to overwrite the existing file or to add a date/time suffix to the file name is optional in this example.
9. Click Run to save and run your script.
10. Open the new file by clicking the link in the Log tab. Notice that the file contains a separate worksheet for the
result set of each query.
The output of this script is one Excel file containing multiple worksheets. Each worksheet contains the result set of a
different query.
Schedule A Script
See Schedule Your Script to learn how to schedule the Automation script.
Automate Tasks
Use Automation to schedule a single script to run reports and queries, save results in Excel spreadsheets, and
distribute results to the business community via email. You can schedule scripts that perform long-running tasks to
run when database activity is light.
You can also use variables in automation scripts. With variables, you can update information that may be different
each time you run the script, such as the department name, revenue, fiscal quarter, or product name. See "Using
Variables in Automation" on page 127 for more information.
For example, assume you are an analyst at Nick's Flicks movie rentals. You need to run inventory and movie rental
reports on a daily basis and distribute them to managers of the inventory department. Using Toad, you can create
an automation script that runs the reports, exports them to Excel spreadsheets, and emails the spreadsheets to the
inventory department everyday at 2:00 AM.
Troubleshooting: You must surround a variable name with the # sign (for example, #sleep#).
Notes:
l Automation scripts are compatible with the version of Toad in which they are created.
l The Automation module is disabled if Toad was installed with the Prohibit saving passwords
option selected.
3. To build a script, single-click an activity in the Toolbox, or drag an activity from the Toolbox to the Automation
script design window. Repeat this process to add additional activities to your script.
Note: You must drag the activity to , then release the mouse button after you see the activity's
icon replace .
4. Click an activity in your script workflow in the design window and then specify the activity's properties in the
details pane (bottom pane). Repeat this process for each activity in your script. For a step by step tutorial on
building an Automation script, see Getting Started with Automation.
See the following topics for details about each activity and its properties:
l Use Database Automation Activities
l Use File Automation Activities
l Use System Automation Activities
Tip: You can save an activity and its settings as a template to reuse in other scripts. Right-click the activity
in the design window and select Save As Template. After you create the first template, a Templates
toolbox displays.
Note: Click Settings in the design window at any time to go back and review the Automation script settings.
5. When you finish building your script, select one of the following actions from the Automation toolbar or the
Wizard bar:
Add to Project Add an automation script to the current project in the Project Manager. The script
is automatically placed in the project's Automation Scripts folder.
Save an automation script (.tas) in a folder on a local or network drive.
Save
Run Run an automation script before scheduling it. The script executes once and the
execution log is displayed in the Log window. Resolve any problems that cause
activities to fail, or disable failed activities before scheduling the script.
Tips:
l Press F5 to run the automation script.
l To view the script log, select the Log tab or select View | Output.
Publish Publish script to Toad Intelligence Central.
Schedule Schedule an automation script in the Job Manager. You can schedule a script to
execute once or to run periodically at a defined interval. See "Execute and
Schedule Automation Scripts" on page 131 for more information.
Important: To rename an Automation script file, do so through Toad (File | Save File As), not through Windows
Explorer. Renaming a script file using Toad ensures that log files are created correctly and properly synced with
their scripts.
Tips:
l Double-click an activity in the script design window to open the Activity Properties pane in a format used in
earlier versions of Toad.
l Right-click within the script design window and select Print Script to print the script's workflow diagram.
Activity Description
Select to File Execute an existing SQL script, Query Builder file, or Editor file and export the results to an
Excel, HTML, or CSV file.
1. Select a database connection.
2. Select a SQL file or enter a SQL statement.
l Click the drop-down list to select a file from the currently open project in the
Project Manager.
l Click to browse to and select a SQL file.
l
Click to open the SQL file in the Editor where you can modify the SQL
file.
l Enter a SQL statement in the editor. You must first deselect the Link SQL
file option.
3. RowCount variable—Enter a name for the row count variable or use the default.
The value assigned to this variable equals the number of rows returned from the
activity. See "Using Variables in Automation" on page 127 for more information.
4. Export File Type—Select an export file type.
5. Export File Name—Click to select a file location and enter a file name. To use a
variable as a suffix, enter the hash symbol before and after the variable name
(#VariableName#).
6. Suffix—Select a suffix to append to the file name. Select from the list of existing
suffixes, or click to select a variable or build a new suffix using the expression
editor.
7. Overwrite—Select to overwrite the file. If you did not add a suffix to the file name,
you can deselect Overwrite to append a new worksheet to the Excel file with each
script execution.
l
Click to open the SQL file in the Editor where you can modify the SQL
file.
l Enter a SQL statement in the editor. You must first deselect the Link SQL
file option.
3. Save result set in variable—Enter a name for the result variable, which contains a
data table with the results of the execution script.
Tip: You can use the result variable with the Loop Dataset activity. See "Use
System Automation Activities" on page 122 for more information.
4. Local Storage—To export the results to Local Storage, select a database and a
new or existing table (or snapshot).
5. Intelligence Central—To export the results to Intelligence Central as a dataset,
click Publishing Wizard and specify your publishing options.
Review the following for additional information:
l RowCount variable—Enter a name for the row count variable or use the default.
The value assigned to this variable equals the number of rows returned from the
activity. See "Using Variables in Automation" on page 127 for more information.
l Overwrite existing dataset—Select to overwrite an existing dataset with the same
name.
Select to Editor with Execute an existing SQL script or Query Builder query and save it and any results sets in a
Results Toad editor file (.tef).
This file format is useful for building scripts that have large result sets that you do not want
to continue executing or for saving results when you have not finished building a script.
1. Select a database connection.
2. Select a SQL file or enter a SQL statement.
l Click the drop-down list to select a file from the currently open project in the
Project Manager.
l Click to browse to and select a SQL file.
l
Click to open the SQL file in the Editor where you can modify the SQL
file.
l Enter a SQL statement in the editor. You must first deselect the Link SQL
file option.
3. Result saved in Editor file—You can select an Editor file from an open project or
suffixes, or click to select a variable or build a new suffix using the expression
editor.
Export Wizard Export data from databases, tables, views, or a query into a CSV, Excel, or other file.
Review the following for additional information:
l Export template—You can select an existing template, edit an existing template, or
create a new template.
Tip: You can use a variable in the file name to select an existing template file by
entering the hash symbol before and after the variable name (#VariableName#).
l Use Automation Connection—Select this option to use the connection associated
with the Export Wizard activity. Clear the checkbox to use the connection
associated with the export template.
l RowCount variable—Enter a name for the row count variable or use the default.
The value assigned to this variable equals the number of rows returned from the
activity. See "Using Variables in Automation" on page 127 for more information.
Import Wizard Import data from a CSV, Excel, or other file into a new table or append to an existing table.
You can also import data from one database to another.
Review the following for additional information:
l Import template—You can select an existing template, edit an existing template, or
create a new template.
Tip: You can use a variable in the file name to select an existing template file by
entering the hash symbol before and after the variable name (#VariableName#).
l Use Automation Connection—Select this option to use the connection associated
with the Import Wizard activity. Clear the checkbox to use the connection
associated with the import template.
l RowCount variable—Enter a name for the row count variable or use the default.
The value assigned to this variable equals the number of rows returned from the
activity. See "Using Variables in Automation" on page 127 for more information.
Toad Report Use this activity to open a Toad Data Report (executing the query) and then export the
results to a file using the layout specified in the Toad Data Report. Several export file
formats are available, including PDF, HTML, and Excel.
You can also select multiple Toad Data Reports and export the results to a single file.
Note: You must create a Toad Data Report file (.tdr) before you can select it using this
activity.
Review the following for additional information:
l Select a connection to execute the Toad Data Report query against.
l Add Reports—Click to browse to and select one or more Toad Data Report files
(.tdr). Click the arrow and select From Project Manager to add the reports in the
currently-open project.
l Edit Report—Click to edit the selected report.
l RowCount variable—Enter a name for the row count variable or use the default.
The value assigned to this variable equals the number of rows returned from the
activity. See "Using Variables in Automation" on page 127 for more information.
l Export file—Enter a name and select a file type and location for your export file.
You can use a variable in this field by entering the hash symbol before and after
suffixes, or click to select a variable or build a new suffix using the expression
editor.
Note: In most cases, the script uses the connection you specify in this activity. However,
when a Toad Data Report contains a cross-connection query, the cross-database
connection in the report takes precedence.
For more information about Toad Data Reports:
l Watch Automation and Toad Data Reports (video).
Toad Pivot Grid Open an existing Toad Pivot Grid file, execute the query, and export the data to Excel or
other file format, Local Storage, or Intelligence Central.
Note: You must create a Toad Pivot Grid file (.tpg) before you can select it using this
activity.
Review the following for additional information:
1. Select a connection to execute the Toad Pivot Grid file against.
2. Select an existing Toad Pivot Grid file. You can browse for a file or select from the
currently-open project. Click to edit the selected pivot file.
3. Export to file—Select a file type and enter a file name and location for your export
file. You can use a variable in this field by entering the hash symbol before and
after the variable name (#VariableName#).
l To export to an Excel pivot table, select Excel Pivot.
l Click Export Options to specify Excel file options.
4. Suffix—Select a suffix to append to the file name. Select from the list of existing
suffixes, or click to select a variable or build a new suffix using the expression
editor.
5. RowCount variable—Enter a name for the row count variable or use the default.
The value assigned to this variable equals the number of rows returned from the
activity. See "Using Variables in Automation" on page 127 for more information.
6. Export to—Select one of the following:
l Local Storage—To export pivoted data to Local Storage, select a database
and a new or existing table.
l Intelligence Central—To export pivoted data to Intelligence Central as a
dataset, click Publishing Wizard and specify your publishing options.
Profile Data Automate data profiling tasks. This activity profiles data from a selected query and exports
a report containing the profiling results.
1. Select a database connection.
2. Select a SQL file or enter a SQL statement.
l Click the drop-down list to select a file from the currently open project in the
Project Manager.
l Click to browse to and select a SQL file.
l
Click to edit the selected file.
l Enter a SQL statement in the editor.
suffixes, or click to select a variable or build a new suffix using the expression
editor.
6. Export Data Profiling File—(Optional) Select a location and enter a file name for
the Toad Profiling Report file (.tpr).
Note: You cannot attach this file in subsequent activities in the script.
See Data Profiling for more information.
Clean Data Automate data transformation and cleansing tasks. This activity opens an existing Toad
Data Cleansing file, performs the transform and cleansing tasks on the current result set,
and exports the modified data to a file, Local Storage, or Intelligence Central.
1. Connection—Select a database connection.
2. Cleaning file—Select a Toad Data Cleansing file or edit an existing file using one of
the following methods:
l Click the drop-down list to select a file from the currently-open project in the
Project Manager.
l Click to browse to and select a file.
l
Click to edit the selected file.
suffixes, or click to select a variable or build a new suffix using the expression
editor.
See Transform and Cleanse Data for more information.
Visualize Data Open an existing Toad Data Visualization file (.tdv), refresh the chart, and export contents
as a report. Select from a number of output file formats, including PDF and Excel.
l Data Visualization document—Select an existing Toad Data Visualization file.
l Output file—Select a file location, file name, and file type for your output file. You
can use a variable in this field by entering the hash symbol before and after the
suffixes, or click to select a variable or build a new suffix using the expression
editor.
See Visualize Data for more information.
Compare Data Open a Toad Data Compare project (.dcp) and export the contents as a summary report
and detailed object reports. Select from a number of output file formats for the summary
report, including PDF and Excel.
l Data Compare Project—Select an existing Toad Data Compare project file.
l Summary Report—Select a file location, file name, and file type for the comparison
summary report file.
l Object reports folder—Select a destination folder for the detailed object
comparison reports generated by the activity.
l Suffix—Select a suffix to append to the file name. Select from the list of existing
suffixes, or click to select a variable or build a new suffix using the expression
editor.
l Generate sync script—Select a location and enter a file name to generate a
synchronization script. Click to configure options for the synchronization
script.
l Execute script—Select to execute the generated script.
l Compare result variable—Enter a variable name or use the default. This variable is
assigned a value of True or False based on the results of the data comparison.
See Create Data Comparisons for more information.
Refresh a Snapshot Use this activity to refresh a snapshot in Local Storage or in Toad Intelligence Central
(TIC). This action will update the snapshot to reflect the current data in the source table.
Select one of the following:
l Local Storage
l Database—Select the database containing the snapshot to refresh.
l Snapshot—Select the snapshot to refresh.
l Intelligence Central
l Select a destination—Select the TIC connection containing the snapshot to
be refreshed.
l Datasource—Select the data source in TIC containing the snapshot to
refresh.
l Snapshot—Select the snapshot to refresh.
Database In previous versions of Toad, the Database Connection activity was required in order to
Connection specify database connection details.
In the current version of Toad, you can specify the database connection details within each
applicable activity, eliminating the need to use the Database activity. You may continue to
use the Database activity if you prefer.
Note: The database connection specified for the Database Connection activity takes
precedence over the connection specified for the individual activity.
l Next, add activities to the loop to execute for each connection in the connection
list.
Note: The connections you specify in the Loop Connections activity take precedence over
any connection specified in an individual activity.
Dimensional Viewer Open an existing Dimensional View file, execute the query, and export the data to Excel,
Local Storage, or Intelligence Central.
1. Select an existing Dimensional View file.
2. Export to file—To export data to Excel or .csv, select a file type, a file location, and
a file name. Click Export Options to specify export options. In the Export dialog,
each tab represents a view.
l Worksheet name—Enter a worksheet name. For an existing file, select the
worksheet from the list. Overwrite must be deselected to display the list.
To add a worksheet to an existing file, select Append worksheet from the
list and enter a new name.
l Append rows—Select to append to the selected worksheet.
l Start export at—Enter the column and row position at which to begin the
export.
3. Export to:
l Local Storage—To export data to Local Storage, select a database.
l Intelligence Central—To publish the data to Intelligence Central as a
select the suffix, click , delete the suffix in the Expression field, and click OK.
l Automation does not support positional parameters denoted by a question mark.
l For each applicable activity, you can specify the database connection in the activity's properties. The
default connection is the currently-active open connection.
l The connection associated with an activity takes precedence over the connection information in a report
or SQL script, unless the report or SQL script information is a cross-connection query.
Activity Description
Copy File Copy or move one or more files to another location (for example, to a shared folder where
they can be accessed by your business community).
Review the following for additional information:
l Source file—Select the file to copy.
In this field, you can also use the asterisk (*) and question mark (?) wildcard
characters, as well as variables, in the file name to help you select one or more files
(in the same directory) to copy. To use this method:
1. Specify the file directory by browsing to and selecting one of the files.
2. Then modify the file name in the Source file field using wildcard characters
and/or variables.
l Copy to folder—Select the destination folder into which you want to copy or move
the file or files.
l Copy name—To rename the copied or moved file, enter a new name.
Note: This field is only applicable when copying a single source file.
l Suffix—Select a suffix to append to the file name. Select from the list of existing
suffixes, or click to select a variable or build a new suffix using the expression
editor.
suffixes, or click to select a variable or build a new suffix using the expression
editor.
l Password—Enter a password if you want to password protect the zip file.
l Hide password—Select this option to mask password during input.
l Encryption—Select whether to create a zip file without encryption (Standard) or to
encrypt the zip file.
Note: If you encrypt the zip file, you must have a zip utility that can support 128-bit or
256-bit decryption.
suffixes, or click to select a variable or build a new suffix using the expression
editor.
Note: Use drag and drop or up/down arrows to change the order of multiple Find/Replace
tasks in one activity.
To learn how to use the Find and Replace activity, see the following:
l Automate Find and Replace (video)
FTP File Upload or download one or more files using an FTP or SFTP connection. Review the
following for additional information:
l Select an FTP connection—Select an FTP connection or define a new connection.
Note: You can define a new connection prior to using the FTP activity by selecting
View | FTP Connections.
l Transfer ONLY if—Select this option to set conditions for FTP transfer, and then
select a condition from the list. If you select this option, the FTP activity only runs if
the condition you specify is met.
l Local directory exists—Select this option to transfer only if a local directory
exists, then browse to and select the directory.
l Local file exists—Select this option to transfer only if a local file exists, then
enter the name of the local file.
l Remote directory exists—Select this option to transfer only if a remote
directory exists, then browse to and select the directory.
l Remote file exists—Select this option to transfer only if a remote file exists,
then enter the name of the remote file.
l Define Operations—Click to specify the files and other options for the FTP upload or
download task. Review the following for additional information:
o Operation—Select Upload or Download.
o Use file mask—Select this option if you want to select files by using a file
mask. Then specify file mask filtering options in the File Mask fields at the
bottom of the page.
o Move files—Select this option to move the files from the source location to
the target location instead of copying them.
l Retry—Specify the number of times to retry the FTP connection if it fails.
l Wait—Specify the number of seconds to wait between retries.
To learn how to use the FTP activity, see the following:
l Automate FTP Upload and Download (video)
Publish Files Publish one or more files to Intelligence Central. You can select files created by previous
activities in this script or other existing files.
Review the following for additional information:
Files to Publish—Click Manage Files to select files created previously in this script or to
browse for other files to publish. In the File Collection Editor do one or both of the
following:
l Select one or more previously-created files in the left pane and click Add.
l Click and then browse to select an existing file.
select the suffix, click , delete the suffix in the Expression field, and click OK.
l Automation does not support positional parameters denoted by a question mark.
Tips:
l
For activities in which you can add a suffix to the output file, click to build a suffix using the
expression editor.
l You can use the expression editor to select a variable created in a previous activity or select one of your
stored bind variables.
Activity Description
Set Variable Automation variables are a powerful tool that can greatly extend your scripts by adding
flexibility and customization. You can use variables to represent and store data that may
be different each time the script executes. Variables can be used with almost every
Automation activity.
Use this activity to define one or more variables.
Review the following for additional information:
l Variable name—Enter a name for the variable. When you use the variable name
later in the script, for example in a file name or in an expression, surround the
variable name with the hash symbol (#MyVariable#).
l Variable type—Specify a variable type.
l SQL—Select SQL if you plan to use the result set of a query as the variable
value.
l DateTime—See Using Variables in Automation for more information about
date variables.
l
Variable value—Enter a value or click to build an expression.
l
If you click to build an expression, select from the list of variables,
operators, and functions. Click a category in the left pane to display a list of
items in the right pane. Double-click an item to add it. Click Test to test the
expression.
l If you selected SQL as the variable type, the variable value options expand
to allow you to specify a query. Select a database connection, then select a
SQL file or enter a SQL statement. Toad uses the result set of the query as
the value for your variable.
See "Using Variables in Automation" on page 127 for more information
about SQL type variables.
l Prompt during run—Select this option to instruct Toad to prompt for a new variable
value during manual execution. The new value is used for the current execution
only. The default value specified in Variable value remains unchanged. The
default value is used for a scheduled script.
l
Variable value—Enter a new value or click to build an expression.
l Add—Click to select an additional previously-defined variable.
See Variable Scope in Using Variables in Automation to learn more about how to use this
activity with the Set Variable activity.
If..Condition.. Execute one or more activities if a condition you specify evaluates to true. You can add
several branches to the If Condition activity to simultaneously evaluate more than one
condition.
To learn how to use the If Condition activity, see the following tutorial:
l Using the If Condition in Automation (video)
Use the expression editor to build an expression that evaluates a condition. Typically this
includes a variable (user-defined or built-in).
l Expression—Build your expression by selecting from the list of variables,
operators, and functions. Click a category in the left pane to display a list of items in
the right pane. Double-click an item to add it. Click Test to test the expression.
l
Click to open the SQL file (you just selected) in the Editor where you
can modify the SQL.
l
After selecting a script, click to open the child script in a new window.
l Return code variable—Enter a variable name or use the default name. The return
code variable is a built-in variable. After the child script executes, the return code
select the suffix, click , delete the suffix in the Expression field, and click OK.
l Automation does not support positional parameters denoted by a question mark.
The following are some examples of where you can use a variable (built-in or user-defined) in an Automation script.
l In the file name of a file exported by an activity.
l In the suffix appended to a file name.
l In an expression used in the While or If Condition activities.
l In a SQL statement as a bind variable for filtering data.
l In a SQL statement as a bind variable in an Import or Export template.
How to Use a Variable
To express the value of a variable, surround the variable name with hash symbols (#), for example #myvar#. The
following are some examples of how variables might be used.
#myvar#_report.xlsx
Report_#Dept_Name#.xlsx
#File_1_RCOUNT# > 0
It is important to remember that when a variable is expressed, the variable value is substituted as text in place of the
variable name (#myvar#). The only exception is when you use a variable as a bind variable in a SQL statement.
'#myvar#' = 'Dog'
About SQL Type Variables
SQL type variables are created in two ways:
l You can create user-defined SQL type variables using the Set Variable activity.
l A built-in SQL variable is created by the Loop Dataset activity, the Execute Script activity, and the Loop
Connection activity.
If you ask just for the variable value of a SQL type variable, Toad returns the value from the first row and column of
the result set. However, you can filter by column using this syntax:
<variable name>.<column name>.
For example, Region.Region_Name returns the first value (first row) in the column Region_Name.
Dataset/SQL Variable - Special Format for Filtering
You can use the following syntax format to filter data from the dataset variable (or any SQL type variable):
<dataset variable name>.<filter parameter>
Example: Loop_data_1_SQL.region_id, where region_id is one column in the dataset variable
For example, use this format in a SQL statement (in a Select to File activity) to select and export data based on each
region_id value in the dataset variable. The statement is executed with each loop of the Dataset activity.
SELECT * FROM address WHERE address.region_id = :Loop_data_1_SQL.region_id
SELECT * FROM address WHERE address.region_id = #Loop_data_1_SQL.region_id#
Bind Variables
You can store global bind variable/value combinations in Toad . After storing a global bind variable, that variable is
available to use in Automation. Your stored global bind variables appear in the list of variables in the expression
editor of applicable activities.
Using a String. For a String variable type, surround the date value in single quotes. This ensures that date
delimiters, such as the dash (-) or forward slash (/), do not cause Toad to interpret the value as an expression.
‘2017-7-7’ is treated as a string
2017-7-7 is evaluated to 2003
Variable Scope
When you are building an Automation script that uses a variable, it is important to understand the variable's scope of
visibility. This section describes the concept of variable scope in Automation scripts.
To configure Toad to use SMTP Emails, we need to get the main data from the following third parties:
l Azure Portal where we register our application
l O365 Admin Center with at least one O365 License E5 where we register the O365 user
l Microsoft Exchange to configure our settings at a higher level
Configuration Steps:
1. First, we register our application in Azure Portal | App Registration.
This refers to the setting from the MS Entra ID | Enterprise Application registration, NOT from App
Registration. To do this it’s necessary to run these PowerShell commands in the order below:
NOTE: The OBJECT_ID is the Object ID from the Overview page of the Enterprise Application node (Azure
Portal) for the application registration. It is not the Object ID from the Overview page of the App Registrations
node. Using the incorrect Objec ID will cause an authentication failure.
5. In Toad Data Point (this example), let’s set the email server specification (TenantID, ObjectID, and
Secret_key).
Quest creates software solutions that make the benefits of new technology real in an increasingly complex IT
landscape. From database and systems management, to Active Directory and Office 365 management, and cyber
security resilience, Quest helps customers solve their next IT challenge now. Around the globe, more than 130,000
companies and 95% of the Fortune 500 count on Quest to deliver proactive management and monitoring for the
next enterprise initiative, find the next solution for complex Microsoft challenges and stay ahead of the next threat.
Quest Software. Where next meets now. For more information, visit www.quest.com.
Contact Quest
For sales or other inquiries, visit www.quest.com/contact.
cross-connection queries 40
A
activities, automation 107 D
automation 107 data
database activities 110 browse parent tables 36
H R
heterogeneous queries 40 reports 90
data tutorial 86
I
DB2 91
Intelligence Central
manage reports 90
publish objects to 72
MySQL 93
intellisense
ODBC 93
shortcut keys 61
Oracle 93
K publish and share 97
keyboard SQLServer 95
editor shortcuts 61 result sets 64
linked queries 68 S
M script results 64
scripts
Master Detail Browser 36
automating 107
O
search 33
Object Explorer 27 database objects 33
filter databases and objects 28 SharePoint
search for objects 33 create connections 20
object search 33 shortcut keys 61
ODBC Snowflake
create connections 10 create connections 15, 25
One Click Export 66 SQL
Oracle automating scripts 107
Oracle, create connections 12 shortcut keys 61
P SQL Azure
create connections 17
parameters 47
SQL Editor 59
bind 47
SQL Server
create connections 17
troubleshoot 24
T
tables
browse data in related 36
troubleshoot
publishing to TIC 83
SQL Server connections 24
tutorials 86
V
variables
Automation 127
bind 47