PLSQL Object Templates


PL/SQL Object 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 4.27 and 4.28 illustrate how this works. Instead of hitting the '.' to signal the replacement, you press Ctrl+Spacebar to signal the replacement.

Figure 4.27. Code completion template key sequence.

Figure 4.28. Code 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 in Figure 4.29.

Figure 4.29. Adding 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 4.30 for the layout example.

Figure 4.30. Code 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 ).

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.


The author uses code templates to help with options in packages, such as the DBMS_OUTPUT package. Notice in Figure 4.31 that typing in the package and then pressing Ctrl+Spacebar gives the additional options available.

Figure 4.31. Code completion in action.




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