Jan 2, 2019 3:26:01 PM by Dan Hotka
DID you know that TOAD comes with a ton of code templates? These templates often have substitution variables as well.
CTRL+ Space bar signals ALL of the templates. You can type in a template name, such as ‘crloop’…and hit the CTRL + Space bar and signal just one template as well.
Notice the &&c1 syntax becomes the subsitution. This panel prompts for the items to plug in, and it remembers what you used the last time you used the wizard.
Here is the resulting code.
DID you know that you can add your own?
Click on Toad Options -> Editor -> Behavior then there is a button for Code Templates.
You can see ALL of the templates available.
Lets add one for DBMS_OUTPUT.Put_Line. Lets place the cursor where one would want to start typing as well.
The ‘|’ tells the template where to put the cursor.
Click Add then fill in the box…click OK (it does an Apply as well)…and OK on the Editor Behavior panel.
Let's try it out. Enter ‘pl’ and then ctrl+space bar…and it works!
Templates are useful for about any repetitive code you prefer. Think about putting your common exception clauses in templates. Of course you can edit any of the existing templates to be more useful for your Oracle coding style, etc.
Tags: Toad for Oracle
Written by Dan Hotka
Dan Hotka is an Author/Instructor/Expert/Oracle ACE Director Alumni who uses TOAD regularly in his web-based and on-line courses. He is well published with many books still available on Amazon or www.DanHotka.com. Dan is available for user groups and company educational events. He regularly speaks at user groups around the world. Check his website for course listings, references, and discount codes for his online courses based in Safari.
Dan's most recent book is Toad for Oracle Unleashed