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 >\temps 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.



TOAD Handbook
TOAD Handbook (2nd Edition)
ISBN: 0321649109
EAN: 2147483647
Year: 2003
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net