- Overview
- Predefined Shortcuts
- User-Defined Shortcuts
- Using Variables
- Table and Column Name Select Lists
- Using Aliases and Autoreplacement Substitutions
- SQL Templates
- Code Completion Templates
- Executing SQL Statements
- Executing SQL Scripts
- Editing Result-Set Data
- Saving Result-Set Data
- Printing Result-Set Data
- Examining Explain Plans
- Examining Basic Performance Info
- Using Auto Trace
- SQL*Plus Compatibility
- Scripts That Write Scripts
- Summary
Scripts That Write Scripts
TOAD supports just about any kind of script. What makes Oracle so powerful is the ability to create scripts that actually build scripts!
TIP
Make sure to run any SQL*Plus script as a script!
The most basic SQL-creating-SQL is the DROP TABLE script. This script can be used to clean up a schema from a departing employee, for example. Figure 3.47 illustrates this simple script. Notice the SPOOL command. The output from this command appears in the Notepad window.
Figure 3.47DROP TABLE SQL-Creating-SQL script.
TOAD can also use SQL-Creating-SQL to create most of the TOAD configuration files such as the ALIASES.TXT file. Figure 3.48 shows this script. Notice that it spooled ALIASES.TXT to the C:\TEMP directory. This file would have to be moved to the <TOAD home directory>\temps directory. The substr can be adjusted.
Figure 3.48Creating the ALIASES.TXT file.
This technique of selecting data mixed with punctuation from USER_OBJECTS can be used to create most, if not all, of the TOAD configuration files.