Home > Articles > Data > Oracle

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

This chapter is from the book

Code Snippets

Toad contains bits of code called code snippets. These snippets contain most of the SQL functions, date formats, hints, and other bits of SQL and PL/SQL code that are of interest to the Oracle developer. Toad configuration options make it possible for additional items to be added or existing items to be changed.

To see the Code Snippets panel choose View → Code Snippets. The panel then appears and auto hides along the right side of Toad (see Figure 3.23). The push pin button can make the panel remain visible on your desktop.


FIGURE 3.23 Code Snippets panel

You simply drag and drop the code pieces from this panel to your code.

Figure 3.24 shows the various categories for the snippets. There are snippets for date formatting, various function templates for almost anything, and even SQL Optimizer hints (discussed some in Chapter 10).


FIGURE 3.24 Code Snippets code categories

These snippets are configurable as well. Click the Configure Toad Options button (or access via the menu using View → Toad Options) and visit the Editor → Code Assistant panel as shown in Figure 3.25. This panel enables you to either clean up the categories you will never use, or better yet, add your own custom code snippets that you can easily add to your code via drag and drop.


FIGURE 3.25 Configuring code snippets

  • + Share This
  • 🔖 Save To Your Account