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!

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.47. DROP 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 > emps directory. The substr can be adjusted.

Figure 3.48. Creating 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.168.73