- 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
Code Completion Templates
Code completion templates are boilerplate syntax where you type in the correct names, and so on, but the correct syntax with options is supplied.
Code completion templates work a lot like aliases except that they provide the entire syntax rather than just a word or object name. Figures 3.30 and 3.31 illustrate how this works. Instead of hitting the '.' to signal the replacement, you press Ctrl+Spacebar to signal the replacement.
Figure 3.30Code completion template key sequence.
Figure 3.31Code completion template in action.
Ctrl+Spacebar signals code template.
Like the autoreplacement feature, additional code completion templates are easily added by using the Edit, Editor Options, Code Templates screen, as shown in Figure 3.32.
Figure 3.32Adding code completion templates.
You can also edit the PLSQL.DCI file in <TOAD Home Directory>\temps and add additional templates with a text editor. See Figure 3.33 for the layout example.
Figure 3.33Code completion template file layout.
Supported languages for code completion are HTML (<TOAD home>\temps\HTMLSUB.DCI), INI (<TOAD home>\temps\INISUB.DCI), JAVA (<TOAD home>\temps\JAVASUB.DCI), and TEXT (<TOAD home>\temps\TEXTSUB.DCI).
NOTE
Be sure TOAD is NOT running when you are editing any of these files in the TEMPS directory. TOAD rewrites these files when closing, and any changes made to the files with TOAD running will be lost.