You can create and reuse code snippets in the Editor.

Note: The file associated with these items is located in:

C:\Users\<user>\AppData\Roaming\Quest Software\Toad for Oracle\<version>\User Files\CodeSnippets.dat

To use Code Snippets

  1. From the View menu, select Code Snippets.
  2. Select a category of code from the box at the top of the window.
  3. Select the code from the list. You can do the following:
    • View a description of the code in the area below the code list
    • Double-click the code to insert it into the active editor tab
    • Drag and drop code into the editor

To Edit Code Snippets

  1. In the Toad Options window (View | Toad Options), select Code Snippets.
  2. In the Code Snippets list, select the category of snippets you want to edit and then click Edit.
  3. Select the snippet you want to edit, and click Edit.
  4. Edit the Oracle Function or the description and click OK.

To Add Code Snippets to an existing category

  1. In the Toad Options window (View | Toad Options), select Code Snippets.
  2. In the Code Snippets list, select the category of snippets and then click Edit.
  3. Click Add.
  4. Enter the code in the Oracle function box.
  5. Enter a description in the Description box.
  6. Click OK.

To Add Code Snippets to a new category.

  1. In the Toad Options window (View | Toad Options), select Code Snippets.
  2. In the Code Snippets list, click Add.
  3. Enter a category name in the Category box.
  4. Enter the code in the Oracle function box.
  5. Enter a description in the Description box.
  6. Click OK.

To highlight a snippet

  1. Place your code in the snippet you want to highlight.
  2. From the Editor menu, select Highlight Snippet (CTRL+H).