Home > Articles > Data > Oracle


  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

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.47Figure 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.48Figure 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.

  • + Share This
  • 🔖 Save To Your Account