TOAD supports the use of its own alias names . Aliases are convenient to shorten keystrokes, using short names instead of rather long table names. TOAD also allows the automatic replacement of text, or in this case, these aliases. The purpose of the alias is to shorten keystrokes. The purpose of the automatic replacement is to automatically resolve the TOAD alias to the full table or column name .
TOAD aliases enable you to
Aliases are easy to set up with any text editor. Make sure TOAD is not running (on network installations, make sure all users are off TOAD) and edit the ALIASES.TXT file found in the TOAD installation directory under the TEMPS subdirectory.
Figure 4.15 illustrates the format of this file. The format is < table name >= < alias name > . Figure 4.15. TOAD alias setup.
TOAD aliases are easy to use. Figure 4.16 shows a simple SQL statement using an alias to get to the Column Name Select drop-down. Notice that the user typed in 'inv.'. The '.' signaled the Column Name Select drop-down and the alias was resolved to the INVENTORY table. Figure 4.16. TOAD alias usage.
Figure 4.17. Available tables to TOAD user.
Figure 4.18. Ignore the alias in action.
Autoreplace substitution replaces a short string with the full name. This differs from TOAD aliases because aliases make reference to a different name but do not change the text of the SQL statement. When autoreplace substitution is defined, it happens automatically when you press the spacebar. Autoreplace substitution is activated by typing the short sequence (notice the "INV_" string illustrated in Figure 4.19) and pressing the spacebar (the autoreplace delimiter key defaults to the spacebar). This will then automatically substitute the predefined string in place of the short key sequence; see Figure 4.20. Figure 4.19. Autoreplace substitution key sequence.
Figure 4.20. Autoreplace substitution in action.
There are two ways to create automatic replacement substitution strings. You can edit the PLSQLSUB.TXT file in the < TOAD home directory >\temps directory. The format is the same as the alias: < short string > = < replacement string > . The other way is to enter the substitution string by using the Edit, Editor Options, Auto Replace tab. See Figure 4.22. Figure 4.22. Adding autoreplace substitution using the Editor Options screen.
Figure 4.21 illustrates the contents of this file. Notice the common typo 'teh' will automatically be converted to 'the' because this sequence will always be followed by pressing the spacebar. Also notice the 'inv' and 'Inv_' strings that were used in Figure 4.19 and Figure 4.20. Figure 4.21. Editing the PLSQLSUB.TXT file.
TOAD allows autosubstitution to be maintained by language type. You can edit and add to the list by using the Editor Options, Auto Replace window. Supported languages for autoreplacement are HTML ( < TOAD home >\temps\HTMLSUB.TXT ), INI ( < TOAD home >\temps\INISUB.TXT ), JAVA ( < TOAD home >\temps\JAVASUB.TXT ), and TEXT ( < TOAD home >\temps\TEXTSUB.TXT ).
TOAD enables you to export and import these autosubstitution definitions. See Figure 4.22. This is a convenient way to move them when setting up a new computer to use TOAD. It also might be convenient to have various autosubstitution files by application. This allows you to have specific substitutions for various applications, same alias but resolved to different names perhaps. When loading autoreplace definitions in from a saved file, all previous substitutions currently in TOAD are lost and replaced with the new definitions.
|